Fix: Where iOS Simulator Screenshots Are Saved in Xcode

Fix: Where iOS Simulator Screenshots Are Saved in Xcode

Written by

in

Quick answer: iOS Simulator screenshots taken via File → Save Screen Shot (⌘S) are saved to your Mac’s Desktop as PNG files named “iOS Simulator Screen shot [date].png”. Screenshots from Xcode’s Devices window also go to the Desktop.

Why this happens

The iOS Simulator writes screenshot files directly to the user’s Desktop by default. This behavior has been consistent across Xcode versions — when you choose File → Save Screen Shot (or press ⌘S) inside the Simulator app, macOS writes a PNG to ~/Desktop with a timestamped filename. The same location is used when you click the Take Screenshot button in Xcode’s Devices and Simulators window (Window → Devices and Simulators).

There is no built-in preference in Simulator or Xcode to change this destination. The files are not placed in the simulator’s sandboxed data container (~/Library/Developer/CoreSimulator/Devices/...) because the screenshot feature is implemented at the Simulator app level, not inside the simulated iOS environment.

How to fix it

1. Locate the default screenshots

  1. Open iOS Simulator (or run your app from Xcode).
  2. Press ⌘S or choose File → Save Screen Shot.
  3. Switch to Finder and open Desktop.
  4. Look for files named:
    iOS Simulator Screen shot Apr 22, 2024 at 10.15.32 AM.png
    or (from Xcode’s Devices window):
    Screen Shot 2024-04-22 at 10.15.32 AM.png

2. Take screenshots programmatically from your app

If you need screenshots saved inside the simulator’s Photos library (e.g., for UI tests), use UIKit APIs:

import UIKit

func saveScreenshotToPhotos() {
    let renderer = UIGraphicsImageRenderer(bounds: UIScreen.main.bounds)
    let image = renderer.image { _ in
        UIApplication.shared.windows.first?.drawHierarchy(in: UIScreen.main.bounds, afterScreenUpdates: true)
    }
    UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}

These images appear in the simulated Photos app and are stored under the simulator’s data directory:

~/Library/Developer/CoreSimulator/Devices/<UDID>/data/Media/DCIM/100APPLE/

3. Change the save location with a keyboard shortcut (macOS)

macOS’s built-in screenshot tool (⌘⇧4, then Space, then click the Simulator window) saves to the location defined in System Settings → Keyboard → Keyboard Shortcuts → Screenshots. You can change that to a custom folder if you prefer not to clutter the Desktop.

4. Automate cleanup with a script

If you generate many screenshots and want them organized, add a simple launchd agent or a folder action on ~/Desktop that moves files matching iOS Simulator Screen shot*.png to a project folder.

How to prevent it

  • Use ⌘⇧4 → Space → Click for one-off captures that respect your macOS screenshot folder setting.
  • For CI / automated runs, call xcrun simctl io booted screenshot <path> to write directly to a chosen directory.
  • Keep the Desktop clean by periodically moving or deleting old simulator screenshots.

FAQ

Can I change the default save location inside Simulator preferences?

No. Simulator has no preference pane for screenshot output. The only way to redirect saves is to use macOS’s global screenshot shortcuts or the simctl command line tool.

Where do screenshots taken via xcrun simctl io booted screenshot go?

They are written to the exact path you provide as the argument, e.g. xcrun simctl io booted screenshot ~/BuildArtifacts/screen.png.

Do screenshots taken on a physical device via Xcode appear in the same place?

Yes. In Window → Devices and Simulators, select a connected iPhone/iPad and click Take Screenshot — the resulting PNG also lands on the Desktop with the Screen Shot <date>.png naming pattern.\n

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.