How to Take a Screenshot or Record a Video of the iOS Simulator

Last updated on: May 27, 2023

In this tutorial, we will learn how to take a screenshot and record a video of the iOS Simulator using both the built-in Simulator app options and Terminal commands. This can be helpful when creating visual documentation, reporting bugs, or showcasing your apps.

iOS Simulator

Taking a Screenshot

  1. Launch the iOS Simulator by opening Xcode and selecting the simulator device you want to use from the active scheme menu, or by running open -a Simulator in Terminal.
  2. Run the app or navigate to the screen you want to capture.
  3. In the Simulator’s menu bar, click “File” and then select “Save Screen”.
  4. Choose the destination folder, and save the screenshot as a PNG file.

Recording a Video

  1. Open the iOS Simulator and run your app or navigate to the screen you want to record.
  2. In the Simulator’s menu bar, click “File” and then select “Record Screen”.
  3. A red circle will appear in the top-right corner of the Simulator window, indicating that the recording has started.
  4. To stop recording, click “File” in the menu bar again and select “Stop Recording”. The recorded video will be saved as an MOV file in your Movies folder by default.

Terminal Commands

Taking a Screenshot

Option 1: Take a screenshot using the simulator UDID

  1. Open Terminal and find the device identifier (UDID) of the simulator you want to capture by running xcrun simctl list.
  2. Take a screenshot using the following command, replacing your_simulator_UDID with the UDID and output_file_path.png with the desired output file path:
xcrun simctl io your_simulator_UDID screenshot output_file_path.png

Option 2: Take a screenshot of the currently booted simulator

  1. Open Terminal.
  2. Run the following command to take a screenshot of the currently booted simulator. Replace output_file_path.png with the desired output file path:
xcrun simctl io booted screenshot output_file_path.png

Recording a Video

Option 1: Record a video using the simulator UDID

  1. Open Terminal and find the device identifier (UDID) of the simulator you want to record by running xcrun simctl list.
  2. Start recording the simulator using the following command, replacing your_simulator_UDID with the UDID and output_file_path.mov with the desired output file path:
xcrun simctl io your_simulator_UDID recordVideo output_file_path.mov

Option 2: Record a video of the currently booted simulator

  1. Open Terminal.
  2. Run the following command to start recording a video of the currently booted simulator. Replace output_file_path.mov with the desired output file path:
xcrun simctl io booted recordVideo output_file_path.mov
  1. To stop the recording, press Ctrl+C in the Terminal window.

If you have any questionsplease feel free to leave a comment below

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments