Skip to content

Instantly share code, notes, and snippets.

@fichek
Last active March 3, 2021 00:09
Show Gist options
  • Save fichek/3be6ead9502049129115792c7e71688d to your computer and use it in GitHub Desktop.
Save fichek/3be6ead9502049129115792c7e71688d to your computer and use it in GitHub Desktop.
iPhone X Simulator Screenshots

Now that you can finally™ submit iPhone X screenshots of your apps to iTunes Connect, here's an easy Terminal command to take a proper screenshot:

xcrun simctl io booted screenshot "~/Desktop/Simulator Screen Shot - iPhone X - $(date +'%Y-%m-%d at %H.%M.%S').png"

This will use Xcode's built-in Simulator command line utility to save a full-frame screenshot of the iPhone X simulator (assuming it's the only one running), without cutting of the notch and rounded corners like cmd+s does. Name is formatted the same as cmd+s would do it and it's also saved to desktop.

Important thing to note: if Debug -> Optimize Rendering for Window Scale is on, screenshot might be saved at wrong resolution, so either turn that off or make sure it's at 100% scale before taking the screenshot (not "Actual Size", but 100%).

@pplante
Copy link

pplante commented Sep 4, 2018

This is kinda old but I found this option keeps the iPhone X notch as an alpha channel (or use --mask=black):

xcrun simctl io booted screenshot --mask=alpha test.png

@SamuelFolledo
Copy link

None of these command lines includes the simulator. This is basically the same as CMD + S

@fichek
Copy link
Author

fichek commented Mar 2, 2021

None of these command lines includes the simulator. This is basically the same as CMD + S

Yes, at the time of posting, this was the only way to get proper screenshots. It's kind slightly outdated now...

@SamuelFolledo
Copy link

I found the answer.
CMD + Shift + 4 + Space and select the simulator as the window to screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment