Use idevicescreenshot for taking screenshots on iOS

Sure. Here is a code on Ruby:

`idevicescreenshot -u #{$device_udid} temp.tiff`
`sips -s format png temp.tiff --out #{screenshot_path}`
`rm ./temp.tiff`

where $device_udid is UDID of iOS device. screenshot_path is path where I save screenshot (should include extension: ../screenshot.png for example).

Or you can do that easily on Shell:

idevicescreenshot -u $1 temp.tiff
sips -s format png temp.tiff --out screenshot.png
rm ./temp.tiff

where $1 will be UDID of the device passed as parameter.

1 Like