In the last tip, I mentioned that iOS Simulator screenshots and screen captures can be taking using the terminal commands
xcrun simctl io booted screenshot ~/Desktop/screenshot.png
xcrun simctl io booted recordVideo ~/Desktop/screencapture.mov
With regard to iPhoneX and other iPhones with a notch, the option
--mask can be very useful:
ignoredapplies no mask, thus a fully rendered image with no corner or notch markings. This is the default value.
alphaapplies an alpha mask with the corners and notch rendered transparent.
blackapplies a black mask with the corners and notch rendered black.
xcrun simctl io booted screenshot --mask alpha ~/Desktop/screenshot.png
Similarly, a screen capture can be taken using
xcrun simctl io booted recordVideo --mask black ~/Desktop/screencapture.mov
black are valid values.
Note that other image and video file formats are supported,
jpeg for images and
fmp4 for videos, defaulting to
This post was generated from a GitHub repository.