Is it safe to delete DerivedData?
Yes. Here is exactly what you lose, how long it takes to come back, and the one folder next to it you should not touch.
Updated 2026-08-13
The short answer
DerivedData holds build intermediates, the code index, module caches and logs. Every byte of it is reproducible from your source. Deleting it cannot lose work — it costs you one slow build and a few minutes of re-indexing.
$ du -sh ~/Library/Developer/Xcode/DerivedDataHow much is actually there before you do anything.
$ rm -rf ~/Library/Developer/Xcode/DerivedData/*Removes the contents, keeps the folder. Xcode recreates what it needs on the next build.
What you actually lose
| Thing | Cost of losing it |
|---|---|
| Compiled object files | One clean build. Minutes to tens of minutes. |
| The code index | Jump-to-definition and autocomplete are degraded until re-indexing finishes. |
| Module cache | Rebuilt on demand, transparently. |
| Build logs | Gone. Rarely missed, occasionally annoying during a bug hunt. |
| Your source code | Nothing. Source is never in DerivedData. |
The honest downside is time, not risk. On a large project with several dependencies, a cold build after clearing DerivedData can take 10–30 minutes. Do not do it five minutes before a demo.
Delete selectively instead
You rarely need to clear all of it. DerivedData is organised per project, and the projects you stopped working on last year are the ones taking the space.
$ du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -h | tail -20The twenty largest project folders, smallest to largest.
$ find ~/Library/Developer/Xcode/DerivedData -maxdepth 1 -mtime +90 -type dProject folders untouched for over 90 days. Read the list before deleting it.
$ find ~/Library/Developer/Xcode/DerivedData -maxdepth 1 -mtime +90 -type d -exec rm -rf {} +Deletes exactly what the previous command listed. Run that one first.
The neighbours, and which ones to leave alone
| Path | Safe to delete? | What it is |
|---|---|---|
| ~/Library/Developer/Xcode/DerivedData | Yes | Build intermediates and index. Fully reproducible. |
| ~/Library/Developer/Xcode/Archives | No, not blindly | Your shipped builds and their dSYMs. Needed to symbolicate crash reports from the App Store. |
| ~/Library/Developer/Xcode/iOS DeviceSupport | Yes, mostly | Symbols for every iOS version you ever attached a device to. Often 20+ GB. Re-downloaded when needed. |
| ~/Library/Developer/CoreSimulator/Devices | Selectively | Simulator disk images. See the simulators guide. |
| ~/Library/Caches/com.apple.dt.Xcode | Yes | Xcode's own cache. Rebuilds itself. |
Device support symbols are usually the second biggest win:
$ du -sh ~/Library/Developer/Xcode/iOS\ DeviceSupport/*One folder per iOS version you have ever debugged against.
$ rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/1[0-6]*Removes symbols for iOS 10 through 16. Xcode re-downloads them if you attach such a device again.
Making it happen less often
- Xcode → Settings → Locations lets you move DerivedData to a per-project folder, which makes stale data obvious and easy to remove with the project.
- Swift Package Manager caches live in ~/Library/Caches/org.swift.swiftpm — worth a look, usually 1–5 GB.
- If you use CocoaPods, ~/Library/Caches/CocoaPods can grow into the gigabytes and is fully reproducible.
Will deleting DerivedData break my project?
No. It contains no source, no configuration and no signing material. Xcode regenerates everything it needs on the next build.
Is Product → Clean Build Folder the same thing?
Not quite. Clean removes the build products for the current scheme; deleting DerivedData removes intermediates, index and module caches for every project. Clean is the smaller hammer.
How long until it comes back?
Immediately, and it will. DerivedData is not a leak — it is a working cache. Expect it to reach the same size again within a few weeks of active work.
Can I delete it while Xcode is running?
It works, but Xcode will be confused until you restart it. Quit first and save yourself the noise.
The automated version
Everything above works, costs nothing, and will keep working. Loupe does the same across every project on your disk at once, and shows what each deletion will cost to rebuild before you agree to it.
Related guides