Skip to content

Instantly share code, notes, and snippets.

@klaaspieter
Last active December 13, 2016 15:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klaaspieter/481e2f70726d070f2ba93a5199d008d6 to your computer and use it in GitHub Desktop.
Save klaaspieter/481e2f70726d070f2ba93a5199d008d6 to your computer and use it in GitHub Desktop.
Record video from the running (> Xcode 8.2) simulator and convert it to gif
#!/bin/sh
output=$1
tmp_file=$(mktemp)
xcrun simctl io booted recordVideo "$tmp_file"
ffmpeg -i "$tmp_file" -pix_fmt rgb24 -r 10 -f gif - \
| gifsicle --optimize=3 > "$output"
rm -r "$tmp_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment