Is it safe to delete Xcode DerivedData?
Yes. DerivedData is Xcode's build cache, and it's often tens of gigabytes. Here's what it is, how to clear it, and what else Xcode leaves behind.
What DerivedData is
Every time you build a project, Xcode writes intermediate build products, indexes and logs to ~/Library/Developer/Xcode/DerivedData, one folder per project. It's there to make the next build faster. Xcode never cleans up folders for projects you've stopped working on, so it grows forever.
Is it safe to delete?
Yes. Nothing in DerivedData is your source code or settings. If you delete it, Xcode recreates what it needs. The only cost is that the next build of each project takes longer, and indexing (autocomplete, jump to definition) catches up in the background.
Quit Xcode first, so it isn't writing to the folder while you delete it.
How to delete it
From Finder
- In Finder, choose Go › Go to Folder… and enter
~/Library/Developer/Xcode/DerivedData. - Move the project folders you don't need to the Trash, or all of them.
From Terminal
rm -rf ~/Library/Developer/Xcode/DerivedData/*
This deletes permanently, with no Trash. Double-check the path before pressing Return.
Other Xcode storage worth checking
| Folder | What it is | Safe to remove? |
|---|---|---|
~/ | Debug symbols copied from each iOS version you've connected a device on | Yes for old iOS versions. They're copied again if you connect that version. Details |
~/ | Simulator devices and their data | Unavailable ones, yes: xcrun simctl delete unavailable. Details |
~/ | Builds you archived for release | Careful. Keep archives of shipped versions if you need their crash symbols. |
~/ | Xcode's own cache | Yes. It's rebuilt. |
Other developer leftovers
The same idea applies to node_modules folders, Rust target folders, Python virtual environments and Gradle caches in projects you haven't touched in months. They're all rebuilt by one install or build command. Two other big ones on developer Macs: Docker's disk and local AI models.
See it on your own Mac
Macaroom scans your Mac, names what each chunk of storage is, and marks what's safe to clear. Anything you remove goes to the Trash, so you can put it back.
Get Macaroom