xcrun simctl io booted recordVideo myVideo.mov
You can specify the following options to the command.
--codec
Specifies the codec type: "h264" or "hevc". Default is "hevc".--display
- iOS: supports "internal" or "external". Default is "internal".
- tvOS: supports only "external"
- watchOS: supports only "internal"
--mask
For non-rectangular displays, handle the mask by policy:- ignored: The mask is ignored and the unmasked framebuffer is saved.
- alpha: Not supported, but retained for compatibility; the mask is rendered black.
- black: The mask is rendered black.
--force
Force the output file to be written to, even if the file already exists.
Example:
xcrun simctl io booted recordVideo --code=h264 --mask=black --force myVideo.mov
xcrun simctl list | grep Booted
xcrun simctl io CC1C80EA-37E6-4B87-8601-AC246EB4F066 recordVideo appbar-after.mov