Gerale Consulting Mac apps

How to delete Xcode DerivedData, simulators and DeviceSupport safely

· Gerale Consulting

Xcode keeps a lot outside Xcode.app: build files, simulators, debug symbols for every iOS version you have connected, archives of every release. After months of work it adds up to many gigabytes, and none of it goes away on its own. Here is what each folder is, how to measure it, how to remove it and what you lose.

Quit Xcode and the Simulator app before deleting anything. None of these folders holds your source code, which stays in your project folder. Almost everything here rebuilds itself; the exceptions are Archives and the apps and data inside the simulators.

Measure first

Most of it is in ~/Library/Developer. This lists its folders by size, the biggest last:

du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* 2>/dev/null | sort -h

Simulator runtimes are stored outside your home folder: xcrun simctl runtime list shows them with their size.

DerivedData

Where: ~/Library/Developer/Xcode/DerivedData. Xcode › Settings › Locations shows the path, with an arrow that opens it in the Finder.

What it is: one folder per project, named after the project plus a random-looking suffix, with intermediate build files, built products, the code index and build logs. Next to them, ModuleCache.noindex holds precompiled modules shared by all projects. It grows with every project and configuration you build, and projects you deleted or moved long ago keep their folder until you remove it.

How to delete it: quit Xcode, then delete the folders of the projects you want, or all of it:

rm -rf ~/Library/Developer/Xcode/DerivedData

Product › Clean Build Folder (⇧⌘K) is not the same thing: it removes the build products of the open project, but leaves its index and every other project in place.

What you lose: nothing permanent. The next build starts from scratch and Xcode indexes the project again, which takes a while on a large codebase. When a build fails for no apparent reason, deleting DerivedData is also the classic fix.

Simulators

Where: ~/Library/Developer/CoreSimulator/Devices, one folder per simulated device, named after its UDID.

What it is: the disk of each simulator, with the apps you installed in it and their data, photos and settings. Every runtime you install adds a set of devices, and the ones created for older versions stay behind.

How to delete them:

xcrun simctl list devices          # every simulator, with its state
xcrun simctl delete unavailable    # simulators whose runtime is no longer installed
xcrun simctl delete <UDID>         # one simulator
xcrun simctl shutdown all          # then:
xcrun simctl erase all             # reset every simulator, keeping the devices

In Xcode: Window › Devices and Simulators, Simulators tab, select one and delete it. ~/Library/Developer/CoreSimulator/Caches can go too: the simulators rebuild it.

What you lose: the apps and data inside the deleted simulators. Unavailable simulators can't start anyway, so removing them costs nothing. Xcode creates new, empty devices whenever you need them (the + button in the same window).

Simulator runtimes

Where: since Xcode 15, simulator runtimes (the iOS, watchOS, tvOS and visionOS systems the simulators run) are disk images stored outside your home folder and managed by the system. Each one takes several gigabytes.

How to delete them:

xcrun simctl runtime list
xcrun simctl runtime delete <identifier>

Or in Xcode › Settings › Components (Platforms in Xcode 15): select the runtime and delete it.

What you lose: the simulators that use that runtime stop working and become “unavailable”. You can download the runtime again from the same Settings pane, or with xcodebuild -downloadPlatform iOS.

iOS DeviceSupport

Where: ~/Library/Developer/Xcode/iOS DeviceSupport, and the same for the other platforms (watchOS DeviceSupport, tvOS DeviceSupport, visionOS DeviceSupport).

What it is: when you connect a device to run or debug on it, Xcode copies the system's debug symbols from it, in one folder per OS version (and device model). Every iOS update you install on your phone adds a new folder of several gigabytes, and the old ones stay.

How to delete it: in the Finder, delete the folders of the versions your devices no longer run. In Terminal:

du -sh ~/Library/Developer/Xcode/*DeviceSupport/* 2>/dev/null
rm -rf "$HOME/Library/Developer/Xcode/iOS DeviceSupport/<folder>"

What you lose: nothing you can't get back. If you connect a device running that version again, Xcode copies the symbols again; it takes a few minutes, during which you can't debug on the device.

Archives

Where: ~/Library/Developer/Xcode/Archives, one folder per day with an .xcarchive for each Product › Archive. They are easier to manage from Window › Organizer › Archives.

What it is: the built app of a release together with its dSYM files, the debug symbols needed to turn a crash report into readable function names and line numbers.

What you lose: this is the one folder that does not regenerate: building the same code again produces different symbols, which do not match the crashes of the version already released. Keep the archives of every version people still use, unless their dSYMs are stored somewhere else (for example uploaded to your crash reporting service). Archives of test builds and of versions nobody runs any more can go.

Other Xcode folders

A routine after every Xcode update

xcrun simctl delete unavailable
rm -rf ~/Library/Developer/Xcode/DerivedData

Then remove the DeviceSupport folders and the runtimes of versions you no longer test on. For the rest of the Mac, from the Trash to Docker, see the guide How to free up disk space on a Mac.

In a few clicks: Vacuo

Vacuo, our app for macOS 14 and later, puts all of this in one list under Xcode, simulators and emulators: DerivedData one row per project, with the project name, when you last used it and whether the project still exists; each simulator with its OS version and last boot; the unavailable simulators in one row; runtimes, with how many simulators use them; DeviceSupport one row per version; archives, marked “review”. Running simulators are left out, and it covers Android Studio too: older SDK platforms, NDKs, emulator images and emulators.

Nothing is selected for you. Simulators and runtimes are removed with xcrun simctl, the same commands as above; the rest is deleted, or moved to the Trash if you turn on that option. The scan is free; cleaning this category requires Vacuo Pro, a one-time purchase.

Discover VacuoDownload free

Read also