Launch iPhone Screen Capture Utility From The Command Line
I have an iPod Touch 2G that is fairly messed up and both the power button and home buttons are currently not working properly which makes taking screenshots much harder than normal in iPhone firmware 2.X and 3.X. If you have installed Cydia however on your iPhone or iPod Touch then you can launch the screen capture from the command line without issue. Once you have taken a screen capture you can then email the photos to yourself or SCP (Secure Copy) them to your computer. To launch the iPhone screen capture utility from the command line follow the directions below.
Snap a Screenshot from the iPhone CLI:
- SSH to Phone: SSH to your phone as you normally would as the root user. Technically you could also do this with a terminal window but then your screen capture would be only of the terminal window. This is also assuming you have already installed OpenSSH via Cydia or Icy. In the below example 192.168.1.100 is the IP address of the iPod Touch.
- Change to Mobile User: Now use “su” to change the user to the mobile user so the screenshots will appear in the “Saved Photos” folder under the Photos application on your iPhone.
yourTouch:/ mobile$ su - mobile
- Take Screenshot Via CLI: Make sure that UIKit Tools is installed via Cydia and then issue the uishoot command as shown below.
yourTouch:/ mobile$ uishoot 2009-10-08 20:21:25.396 uishoot[186.903] DONE: /var/mobile/Media/DCIM/999APPLE/IMG_0001.PNG
After you issue the uishoot command you should get a response via the shell letting you know that its complete and the location/name of the saved image.
- View Pictures: On the iPhone or iPod Touch click on Photos from the home screen. Your screen captures will be located in the “Saved Photos” folder.
That is all you have to do. Below is an example of using uishoot via the Terminal application on an iPod Touch.
As you can see when the uishoot command is issued the screenshot will be of what is specifically showing on your iPhone screen at the time. Using the command line to perform the screen capture also allows you to take screenshots of a locked device as well.