Skip to content

Instantly share code, notes, and snippets.

@pwfcurry
Last active February 27, 2019 13:44
Show Gist options
  • Save pwfcurry/b392f8360d97d2a258cc49663b0c2949 to your computer and use it in GitHub Desktop.
Save pwfcurry/b392f8360d97d2a258cc49663b0c2949 to your computer and use it in GitHub Desktop.
Record iOS simulator & convert to gif
# Record Simulator screen - CTRL+C to finish
xcrun simctl io booted recordVideo appVideo.mov
# Optionally, convert to gif to attach to a GitHub PR:
# install dependencies
brew install ffmpeg -- --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
brew install imagemagick
# convert .mov to a series of PNGs
mkdir output
ffmpeg -i appVideo.mov -vf scale=320:-1 -r 10 output/ffout%3d.png
# stitch PNGs together into a gif, with a pause between loops
convert -delay 8 output/ffout*.png -delay 500 output/ffout001.png -loop 0 output/animation.gif
# or with no pause
convert -delay 8 -loop 0 output/ffout*.png output/appVideo.gif
# or with looping disabled
convert -delay 8 -loop 1 output/ffout*.png output/appVideo.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment