How to clear Xcode DerivedData safely

DerivedData is Xcode’s build cache. Clearing it is almost always safe — Xcode rebuilds what it needs — but you should quit Xcode first and know the path.

Where it lives

Default path:

~/Library/Developer/Xcode/DerivedData

Open Finder → Go → Go to Folder… and paste that path. Folder size often dwarfs the app itself.

Safe clear (manual)

# Quit Xcode first
rm -rf ~/Library/Developer/Xcode/DerivedData/*

Or: Xcode → Settings → Locations → Derived Data → arrow → move to Trash. Prefer Trash over rm if you want undo.

What you lose

See size before you delete

devdisk is a free, read-only scanner. It lists DerivedData under Safe to regenerate, builds a cleanup script from your selection, and never deletes anything itself.

curl -fsSLO https://disk.sadana.app/devdisk.py && python3 devdisk.py

Sample report (includes DerivedData).

Run free scannerSample report

FAQ

Will clearing DerivedData break my project?

No. Source stays put. The next build regenerates caches. Close Xcode before deleting.

Is Archives the same thing?

No. Archives live under ~/Library/Developer/Xcode/Archives. Don’t wipe those if you need old App Store uploads.

Can an app delete this for me?

devdisk only reports. A planned desktop app would move to Trash after you confirm — join the waitlist on the home page.