Record a gif from your iOS simulator in a jiffy
Assuming that you have Homebrew installed, execute the following steps:
- Use this repository as a "tap" (alternative package repository):
$ brew tap fjcaetano/ios-simulator-gif https://github.com/fjcaetano/ios-simulator-gif.git
- Install ios-simulator-gif (and dependencies):
$ brew install ios-simulator-gif
$ ios-simulator-gif [options] {out_file} {-- [ffmpeg options]}
Options | Description | Default value |
---|---|---|
-r, --rate | Framerate of the output | 15 |
-f, --format | Output format | gif |
-vf, --video-filter | Video filter for ffmpeg |
scale=320:-1 |
-t, --transpose | Transpose the video for landscape orientation | N/A |
--no-watermark | Remove watermark from gif | N/A |
-h, --help | Prints helper message | N/A |
-v, --version | Prints current version | N/A |
If no file name is given, it will save the gif to ./simulator.gif
When recording a video in landscape mode you'll need to provide the appropriate transposing argument. It's usually the following:
--transpose 1
when the simulator is rotated 90º (camera to the right)--transpose 2
when the simulator is rotated 270º (camera to the left)
If you need to send extra arguments to ffmpeg
, everything sent after double slashes (--
) will be
sent to ffmpeg
as arguments:
$ ios-simulator-gif -r 30 example.gif -- -b 128k