Last active
September 9, 2024 20:29
-
-
Save thanhzusu/711e63aad8776b5f1125f425b4a0a04b to your computer and use it in GitHub Desktop.
Take a screenshot or video by Xcode command-line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
To take screenshot you have to also to pass a filename: