How to clear Xcode's cache and free up space on your Mac
Xcode can quietly use tens of gigabytes. Most of it is cache that Xcode rebuilds when it needs it, but not all of it. Here is where the space goes, and what is safe to remove.
Where Xcode keeps its files
| Folder | What it holds | Safe to remove? |
|---|---|---|
~/Library/Developer/Xcode/DerivedData |
Build products and indexes for every project | Yes. Xcode rebuilds them, so your next build is slower. |
~/Library/Developer/Xcode/iOS DeviceSupport |
Debug symbols for each iOS version you’ve connected | Yes, for versions you no longer test on. Xcode copies them again when that device connects. |
~/Library/Developer/CoreSimulator/Caches |
Simulator caches | Yes. |
| Unavailable simulators | Simulators for runtimes you no longer have | Yes, with the command below. |
~/Library/Developer/Xcode/Archives |
Your app archives, with their dSYMs | Careful. You need the dSYMs to read crash reports from released builds. Keep the archives of versions people still use. |
Clear it by hand
-
Quit Xcode.
-
In Finder, choose Go ▸ Go to Folder… (⇧⌘G), paste a path from the table, and move what you don’t need to the Trash.
-
Remove simulators for missing runtimes in Terminal. This one deletes them directly, with no Trash:
xcrun simctl delete unavailable -
Empty the Trash to get the space back.
See all of it at once with Sleuth
Sleuth’s Developer view (⇧⌘E) (shown on Macs where it finds developer tools) lists these Xcode folders, along with Gradle, Android, Flutter, CocoaPods, Node and other tools’ caches, each with its size.
- Open any folder to see what’s inside, largest first, down to the files.
- Move what you don’t need to the Trash. Put back returns it if you change your mind.
- Where a tool has its own clean command, such as
xcrun simctl delete unavailable, Sleuth can run it after you confirm. Like the command in Terminal, it clears the caches itself, so there’s nothing to put back.
Moving a folder to the Trash is free; running the clean commands is part of Sleuth Pro, and every feature is free during the free trial.