Take screenshots in the iOS simulator
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
The fastest way to take a screenshot in the iOS Simulator is the keyboard shortcut Command + S, which saves a PNG to your desktop. For automated workflows and CI pipelines, use xcrun simctl io booted screenshot to capture screenshots from the command line. For integration test suites, XCUIScreenshot lets you capture and attach screenshots programmatically during test execution.
Method 1: Keyboard Shortcut (Command + S)
With the Simulator in focus and your app showing the screen you want to capture:
- Press Command + S.
- The screenshot saves as a PNG file to your desktop by default.
You can also use the menu: File > Save Screenshot. The behavior is identical. The saved image matches the simulated device's native resolution (for example, 1179 x 2556 for iPhone 15 Pro at 3x).
Changing the Default Save Location
The Simulator saves screenshots to your desktop. To change this, use the defaults command:
Create the directory first if it does not exist:
Method 2: Command Line with xcrun simctl
The simctl io subcommand captures screenshots without GUI interaction, making it ideal for automation.
To capture from a simulator that is not currently booted or when multiple simulators are running, specify the UDID:
Capturing Screenshots Across Multiple Devices
This script captures screenshots from every booted simulator, useful for generating App Store screenshots across device sizes:
Method 3: Programmatic Screenshots in XCTest
For automated testing, XCUIScreen provides screenshot capture that can be attached to test results.
Screenshots attached with .keepAlways appear in the Xcode Test Report and can be exported from the .xcresult bundle.
Extracting Screenshots from Test Results
After running tests, extract screenshots from the result bundle using xcresulttool:
Method 4: Recording Video (Bonus)
While not a screenshot, simctl io also supports video recording, which is useful for capturing interaction flows:
The video records at the device's native resolution and frame rate.
Comparison of Screenshot Methods
| Method | Best for | Automatable | Output format | Resolution |
| Command + S | Quick manual captures | No | PNG | Device native |
xcrun simctl io screenshot | CI pipelines, scripted captures | Yes | PNG, JPEG | Device native |
XCUIScreenshot in XCTest | Test documentation, regression testing | Yes | PNG (in xcresult) | Device native |
| Xcode Devices window | One-off captures during debugging | No | PNG | Device native |
Screenshot Resolution by Device
| Simulator device | Resolution (points) | Resolution (pixels at scale) |
| iPhone SE (3rd gen) | 375 x 667 | 750 x 1334 (2x) |
| iPhone 15 | 393 x 852 | 1179 x 2556 (3x) |
| iPhone 15 Pro Max | 430 x 932 | 1290 x 2796 (3x) |
| iPad Pro 12.9" | 1024 x 1366 | 2048 x 2732 (2x) |
The Simulator window scale (Window > Physical Size / Point Accurate / Pixel Accurate) does not affect the saved screenshot resolution. Screenshots always capture at the device's native pixel resolution.
Generating App Store Screenshots
For App Store submission, you need screenshots at specific device sizes. Combine simctl with fastlane snapshot for a fully automated workflow:
Common Pitfalls
Capturing at the wrong window scale. Developers sometimes resize the Simulator window to fit their screen and assume the screenshot resolution changes. It does not. Screenshots always use the device's native resolution regardless of the window scale setting.
Screenshots include the status bar. The Simulator's status bar shows "9:41 AM" by default (Apple's canonical time for marketing screenshots). If you need to hide or customize it, use xcrun simctl status_bar to override displayed values:
Forgetting to reset the screenshot directory. If you change the save location with defaults write and later delete that directory, Command + S will silently fail. Verify the directory exists or reset to the default with defaults delete com.apple.iphonesimulator ScreenShotSaveLocation.
XCTest screenshots not appearing in results. If you use .deleteOnSuccess as the attachment lifetime, screenshots from passing tests are discarded. Use .keepAlways when you need screenshots for documentation or regression comparison.
Running simctl screenshot against a shutdown simulator. The command fails with a vague error if no simulator is booted. Always check xcrun simctl list devices | grep Booted before scripting captures.
Summary
For manual captures during development, Command + S is the simplest option and saves PNG files at device-native resolution. For CI and automation, xcrun simctl io booted screenshot provides scriptable, format-configurable captures that work without GUI interaction. For test suites, use XCUIScreenshot to attach captures to test results for visual regression tracking. Screenshots always render at the simulated device's native resolution regardless of the Simulator window size, and you can control status bar content with simctl status_bar for clean App Store screenshots.

