Skip to content

Instantly share code, notes, and snippets.

@thanhzusu
Last active November 13, 2023 14:55
Show Gist options
  • Save thanhzusu/711e63aad8776b5f1125f425b4a0a04b to your computer and use it in GitHub Desktop.
Save thanhzusu/711e63aad8776b5f1125f425b4a0a04b to your computer and use it in GitHub Desktop.
Take a screenshot or video by Xcode command-line
For Xcode 8.2 or later
You can take videos and screenshots of Simulator using the xcrun Xcode command-line utility.
1. Run your app on the simulator.
2. Open Terminal.app
3. Run the command
- To take a screenshot, xcrun simctl io booted screenshot
- To take a video, xcrun simctl io booted recordVideo <filename>.<file extension>.
For example: xcrun simctl io booted recordVideo appvideo.mov
Press cntrl + c to stop recording the video.
The default location for the created file is the current directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment