How to Clear the macOS CoreSimulator Cache via Terminal

The Xcode Simulator Burden

If you are an iOS developer using Xcode on a Mac, you rely heavily on the iOS Simulator to test your applications across dozens of different virtual devices (iPhone 15, iPad Pro, Apple Watch, etc.). Every time you launch a virtual device, the CoreSimulator framework spins up a massive, highly complex virtual environment on your hard drive, complete with its own sandboxed filesystem, cached application binaries, and simulated hardware states.

Over months of active development, this CoreSimulator cache can bloat to dozens or even hundreds of gigabytes. Worse, if a simulator crashes unexpectedly during a build, the cached state can become corrupted. Symptoms of this corruption include the iOS Simulator getting stuck on a black screen forever, Xcode throwing vague “Unable to boot device” errors, or the simulator launching but refusing to install your latest build.

While you can click “Erase All Content and Settings” within the Simulator GUI for a single device, fixing a deeply corrupted CoreSimulator framework requires purging the entire cache via the Terminal.

Locating the CoreSimulator Directory

The CoreSimulator files are not stored in the system root; they are located within your specific user profile’s Library folder, ensuring that multiple developers on the same Mac have isolated simulator environments.

The primary directory is located at: ~/Library/Developer/CoreSimulator/

Purging the Cache via Terminal

Because these files belong to your user account, you do not need elevated (sudo) privileges to delete them, but you must ensure Xcode and all simulator instances are completely closed before proceeding.

  1. Quit Xcode and the Simulator application.
  2. Open the Terminal application.
  3. Execute the following command to forcefully remove the entire Devices cache directory:
rm -rf ~/Library/Developer/CoreSimulator/Devices/*

This command deletes the virtual hard drives for every single simulated iPhone, iPad, and Apple Watch on your machine. The command executes silently, and you should instantly notice a massive recovery of free disk space on your Mac.

Resetting the CoreSimulator Service

Deleting the physical files is only the first step. macOS runs a background daemon (com.apple.CoreSimulator.CoreSimulatorService) that manages the lifecycle of these virtual devices. If the daemon is holding onto corrupted memory pointers, the Simulator will still fail to launch even after you delete the files.

You must forcefully terminate the background service. It is owned by your user, so a standard kill command works:

killall -9 com.apple.CoreSimulator.CoreSimulatorService

(The -9 flag ensures a hard, immediate termination, rather than politely asking the service to stop).

Re-initializing the Simulators

Your Mac is now completely wiped of all iOS simulator data.

The next time you open Xcode and run your project on an “iPhone 15 Pro” target, Xcode will pause for a few seconds. It will reach into the CoreSimulator framework, generate a brand-new, clean virtual device from the base iOS image, and boot it. This initial boot will take slightly longer than usual as it builds a fresh, uncorrupted cache, but all subsequent builds will be lightning-fast and stable.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.