How to Clean Xcode CoreSimulator Devices and Reclaim Disk Space

How to Clean Xcode CoreSimulator Devices and Reclaim Disk Space

Written by

in

Quick answer: Yes, it is completely safe to delete the contents of ~/Library/Developer/CoreSimulator/Devices. Before deleting the directory manually, run ‘xcrun simctl delete unavailable’ in Terminal to remove orphaned simulator runtimes, or quit Xcode and the Simulator app, stop the CoreSimulator service, and delete the folder to reclaim disk space.

Why this happens

Every time you run an iOS, watchOS, tvOS, or visionOS simulator, Xcode creates an isolated sandbox inside ~/Library/Developer/CoreSimulator/Devices. Each simulated hardware profile is assigned an individual Universally Unique Identifier (UUID). Inside each UUID directory, CoreSimulator maintains a virtual disk containing the simulated system environment, installed apps, documents, user defaults, temporary caches, and system log databases.

Over months of active development, this directory regularly expands to 30 GB or more. Whenever macOS installs Xcode updates or downloads newer platform SDKs, earlier simulator runtimes become inactive or mismatched. However, CoreSimulator preserves the older device instances and installed app data on disk rather than pruning them automatically.

Because these device folders hold user-specific runtime states rather than critical Xcode toolchain binaries, removing them causes no lasting damage. If Xcode needs a default device instance that no longer exists, it generates a fresh container the next time you boot that runtime.

How to fix it

1. Remove unavailable and orphaned simulators via simctl

The safest and fastest way to clean obsolete simulator data is using the command-line interface bundled with Xcode tools (simctl). When you upgrade Xcode and delete old simulator runtime packages, the associated device directories remain marked as “unavailable” on your drive.

Open Terminal and execute:

xcrun simctl delete unavailable

This scans ~/Library/Developer/CoreSimulator/Devices, checks every device metadata file against currently installed simulator runtime runtimes, and immediately deletes any device containers tied to runtimes that are no longer installed. This single command frequently reclaims 10 GB to 20 GB of storage without affecting current projects.

2. Erase content and settings across all active simulators

If you want to keep your configured simulator device list intact but discard accumulated app bundles, photo libraries, Safari caches, and Core Data stores, erase their data layers in bulk:

# Shut down all active simulator processes first
xcrun simctl shutdown all

# Wipe user content and settings from all simulator devices
xcrun simctl erase all

This resets every simulated device back to a pristine factory state. It retains your configured device pairings and system OS versions while wiping heavy cache files and test databases.

3. Delete the Devices folder manually

If you need to wipe everything and reclaim all possible disk space immediately, you can delete the contents of the Devices folder.

Before removing the files, ensure that the background simulator daemon is stopped. If com.apple.CoreSimulator.CoreSimulatorService is actively writing to disk when files are deleted, device registries can become desynchronized.

Run the following commands in Terminal:

# Quit Simulator and Xcode
killall Simulator 2>/dev/null
killall Xcode 2>/dev/null

# Terminate the background simulator service
killall -9 com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null

# Remove all device sandboxes
rm -rf ~/Library/Developer/CoreSimulator/Devices/*

Once deleted, launch Xcode or open the Simulator app. Xcode automatically provisions the default device set (such as the latest iPhone and iPad models) for your installed SDKs.

4. Remove specific devices using the Xcode GUI

If you prefer to review specific devices and inspect disk usage before deleting them, use Xcode’s built-in manager:

  1. Launch Xcode.
  2. In the menu bar, navigate to Window > Devices and Simulators (or press Shift-Command-2).
  3. Click the Simulators tab at the top of the window.
  4. Scroll through the left sidebar to locate outdated or duplicated devices.
  5. Right-click the simulator you wish to discard and select Delete.

Deleting devices through this interface cleanly deregisters them from CoreSimulator and frees up their matching container directories immediately.

5. Inspect and remove redundant runtime images

Simulator storage bloat is often caused by duplicate or superseded runtime disk images rather than the device sandboxes themselves. Check which runtimes are currently taking up space:

xcrun simctl runtime list

In modern Xcode versions, downloaded platform runtimes are stored in /Library/Developer/CoreSimulator/Profiles/Runtimes or managed under Xcode preferences. To remove unused disk images via the interface:

  1. Open Xcode > Settings (Command-,).
  2. Select the Platforms (or Components) tab.
  3. Locate any earlier iOS, watchOS, or tvOS runtimes that you no longer target.
  4. Right-click the runtime and choose Delete.

How to prevent it

  • Add a periodic maintenance alias to your shell profile (~/.zshrc) to run xcrun simctl delete unavailable after every major Xcode update.
  • Avoid generating new custom simulator pairings unless required for specific screen-resolution testing.
  • Use xcrun simctl erase all periodically instead of letting months of local app sandboxes, mock downloads, and temporary files accumulate.
  • Do not duplicate simulator runtimes across multiple local user accounts on the same development Mac.

FAQ

Will deleting the CoreSimulator Devices folder reset my project settings or code?

No. Your source code, schemes, build targets, and project files remain untouched in your project repositories. Only local simulator caches, installed test builds, and simulator-specific app sandbox data are removed.

Why does the Devices folder immediately recreate several gigabytes after deletion?

When Xcode or the Simulator app launches, it automatically seeds baseline device environments for the active platform SDKs. A clean set of default simulated devices typically requires between 1 GB and 3 GB of disk space to establish initial system containers.

Can I relocate the CoreSimulator directory to an external drive?

Moving ~/Library/Developer/CoreSimulator using symbolic links is not officially supported by Apple and frequently causes permission errors, sandbox violations, or simulator boot failures (Unable to boot the simulator). Keep the active directory on your primary APFS boot volume and use xcrun simctl to prune unneeded files instead.

Sources & credits

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