Thursday, 28 June 2012

Take an iPhone or iPad Screenshot from the Command-line


Here's another tip using the great libimobiledevice library http://www.libimobiledevice.org/, originally built to manage iOS devices on Linux.

Taking app screenshots is a bit of a pain. We tend to do the following:

  • Run the app
  • Press Home+Power together to take a photo,
  • Go to the photo library
  • Find the photos
  • Email them to ourselves.

Using this method you can type a Terminal command, and have the screen appear directly on your computer. Much easier.
Here's how:

Connect your device, open up Terminal.app and type:

idevicescreenshot

It'll save a .TIFF file to the current directory. Easy!

4 comments:

  1. Do you know a method to do screenshots from iphone command line?

    Thanks

    ReplyDelete
  2. Cool beans ! This works great on my iOS 7 devices.

    But on my iOS 6.1.6 device, I'm getting this error message: "Could not start screenshotr service! Remember that you have to mount the Developer disk image on your device if you want to use the screenshotr service."
    And in the syslogs I'm seeing the following:
    Mar 25 10:55:12 GinoPod-4 lockdownd[43] : 014c3000 spawn_and_handle_checkin: Could not spawn the com.apple.mobile.screenshotr service agent:InvalidService

    Is there a simple resolution to this issue ?

    Thanks :).

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete