We will see how to take screenshot of iOS simulator screen using Xcode command-line utility
Note : Install xcode from apple store.
Steps to capture simulator screen
- Open the app on the simulator
- Open terminal and run below command
xcrun simctl io booted screenshot <filename.jpg>
Steps to record simulator screen
- Open the app on the simulator
- Open terminal and run below command
xcrun simctl io booted recordVideo <filename>.<file extension>
Note – to stop the recording, press ctrl+c
Default location of the created file is under current directory, means if the terminal is opened from mac user location, then you can find the created files under your user folder.
Alternate way – Even you can use MacOS default recording utility “Quick time player” to record the simulator screen.
Hi
I tried your code on my project which has a paired Apple Watch and it only records video of the watch, how do you ‘activate’ each window. I have tried clicking in their windows and title bar but it only records the watch.