Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Automate capturing screenshots of the iPhone simulator

View iphone-screenshot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/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
 
 
 
 
 
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.