Skip to content

Instantly share code, notes, and snippets.

@rafaelp
Created December 1, 2013 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelp/7740885 to your computer and use it in GitHub Desktop.
Save rafaelp/7740885 to your computer and use it in GitHub Desktop.
Script to screenshot the iPhone Simulator to the correct size
#!/bin/sh
# script to screenshot the iPhone Simulator to the correct size
# to upload to iTunes Connect
# written by Jehiah Czebotar http://jehiah.cz/
OUTPUTDIR=~/Desktop
TEMPFILE=iPhoneSimulatorScreenshot_`date +%Y%m%d_%H%M%S`.png
echo "output filename:\c"
read -e OUTPUTFILE
# activate iPhone Simulator so its easy to click on
osascript -e 'tell application "iPhone Simulator"' -e 'activate' -e 'end tell'
# capture the screen
screencapture -iowW $OUTPUTDIR/$TEMPFILE
# resize to the apple upload size, 320x480
sips -c 480 320 $OUTPUTDIR/$TEMPFILE --out $OUTPUTDIR/$OUTPUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment