Is it safe to delete DerivedData?
Yes. DerivedData holds build products, indexes and logs that Xcode creates while it compiles. Xcode rebuilds it the next time you build, so deleting it costs you only a slower first build. It is the first place to look when Xcode is using a lot of space or behaving strangely after an update.
Where it is
By default it is at ~/Library/Developer/Xcode/DerivedData. In Xcode, open Settings, then Locations, to see the path and open it in Finder. Quit Xcode first.
How to clear it
- Quit Xcode.
- In Finder choose Go, then Go to Folder, and paste the path above.
- Move the project folders inside to the Trash, or from Terminal run
rm -rf ~/Library/Developer/Xcode/DerivedData. - Open your project and build. The first build is slower while Xcode recreates the index.
What else Xcode piles up
| Folder | Safe to delete? | Notes |
|---|---|---|
DerivedData | Yes | Rebuilt on the next build. |
iOS DeviceSupport | Mostly | Symbols copied from devices you connected. Re-created when you connect them again. |
Archives | Careful | Your shipped builds. You may need them to symbolicate crash reports. Keep releases you still support. |
CoreSimulator devices | Partly | Remove unused simulators; this also removes their app data. |
Clear unused simulators
Run xcrun simctl delete unavailable to remove simulators for runtimes you no longer have. In Xcode, Settings and then Platforms lets you remove simulator runtimes you do not use.
A careful approach
- Look at the sizes first, so you know what is worth clearing.
- Start with DerivedData, then DeviceSupport, then unused simulators.
- Leave Archives for releases you may need to debug.
- Move items to the Trash rather than deleting permanently.
sysZivo’s Xcode developer filter finds these folders for you and shows their sizes on the storage map, so you can decide with the numbers in front of you. See also cleaning node_modules and Docker cache and what System Data is.
Questions people ask
Is it safe to delete Xcode DerivedData?
Yes. Xcode rebuilds it on the next build. Quit Xcode first. The only cost is a slower first build.
Where is DerivedData on a Mac?
At ~/Library/Developer/Xcode/DerivedData by default. Xcode Settings, then Locations, shows the path.
Can I delete Xcode Archives?
Only the ones you no longer need. Archives hold shipped builds and are useful for crash symbolication.