LinuxCommandLibrary

idevicescreenshot

Take screenshots of connected iOS devices

TLDR

Save a screenshot with the default file name as a TIFF image

$ idevicescreenshot
copy

Save a screenshot with a specific file name
$ idevicescreenshot [path/to/file.tiff]
copy

SYNOPSIS

idevicescreenshot [OPTIONS] [FILE]

PARAMETERS

-u, --udid UDID
    Selects the target device by its unique device identifier (UDID). This is useful when multiple iOS devices are connected to the host computer.

-f, --format FORMAT
    Specifies the output image format. Supported formats include png, tiff, and jpeg. The default format is tiff.

-s, --screen SCREEN
    Designates which screen to capture. Possible values are main (for the device's primary display) or external (if an external display is connected).

-t, --timeout TIMEOUT
    Sets a timeout for the operation in milliseconds. If the specified timeout is reached before the screenshot is captured, the operation will abort.

-h, --help
    Displays a brief usage message and available options for the command.

-v, --version
    Prints the version information of the idevicescreenshot utility.

DESCRIPTION

idevicescreenshot is a command-line utility from the libimobiledevice suite, designed for interacting with iOS devices. It enables users to capture the current screen content of an attached Apple device (iPhone, iPad, iPod touch) and save it as an image file on the local computer. This tool offers a convenient and programmatic method to obtain visual feedback from the device without requiring direct interaction with the device's screen or proprietary software like Xcode.

It's particularly valuable for automation scripts, quality assurance testing, or documentation purposes where capturing device states is essential. The utility establishes a connection to the iOS device via USB and leverages Apple's MobileDevice protocol to request and retrieve the screenshot data.

CAVEATS

For idevicescreenshot to function correctly, the connected iOS device must be unlocked and 'trusted' by the host computer (i.e., you must have tapped 'Trust' on the device when prompted).

The tool may not work on devices in specific low-level modes (like DFU or Recovery mode) or with certain highly restricted iOS versions. The default output format, TIFF, can result in very large file sizes; consider using png or jpeg for more efficient storage or web usage.

OUTPUT FILENAME

If no FILE argument is provided, idevicescreenshot will automatically generate a default filename for the output image, typically in the format screenshot-.tiff, where reflects the time of capture.

USAGE WITH MULTIPLE DEVICES

When multiple iOS devices are connected to the same computer, it is crucial to use the -u or --udid option to specify which device should have its screenshot captured. Without this, the command's behavior might be undefined or it might fail if it cannot determine the target device.

HISTORY

idevicescreenshot is an integral part of the libimobiledevice project, an open-source initiative that began in the late 2000s. Its primary goal was to create a free, cross-platform alternative to Apple's proprietary MobileDevice framework, enabling communication with iOS devices on Linux, macOS, and Windows. The command, like other tools in the suite, has undergone continuous development to maintain compatibility with new iOS versions and device models, ensuring its utility for developers, testers, and power users interacting with Apple's ecosystem.

SEE ALSO

idevice_id(1), ideviceinfo(1), idevicebackup2(1), idevicerestore(1)

Copied to clipboard