public
Created

Automate capturing screenshots of the iPhone simulator

  • Download Gist
iphone-screenshot
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/sh
 
# A) Run ./iphone-screenshot
# B) Type in the screenshot filename
# C) Click on the iPhone simulator
 
OUTPUTDIR=~/Desktop
TEMPFILE=iphone_screenshot_temp.png
 
echo "output filename:\c"
read -e OUTPUTFILE
 
osascript -e 'tell application "iPhone Simulator"' -e 'activate' -e 'end tell'
screencapture -iowW $OUTPUTDIR/$TEMPFILE
sips -c 960 640 $OUTPUTDIR/$TEMPFILE --out $OUTPUTDIR/$OUTPUTFILE
rm $OUTPUTDIR/$TEMPFILE

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.