Skip to content

Instantly share code, notes, and snippets.

@gringoh
Last active October 14, 2021 16:21
Show Gist options
  • Save gringoh/ee5eb3b880a55758159e91d82f7dd7be to your computer and use it in GitHub Desktop.
Save gringoh/ee5eb3b880a55758159e91d82f7dd7be to your computer and use it in GitHub Desktop.
[iOS: Record simulator screen] #ios

iOS. Record simulator screen

xcrun simctl io booted recordVideo myVideo.mov

Options

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

Specify wich device you want to record

xcrun simctl list | grep Booted
xcrun simctl io CC1C80EA-37E6-4B87-8601-AC246EB4F066 recordVideo appbar-after.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment