Xcode DerivedData is the folder where Xcode stores build products, project indexes and logs for every project you open. It is safe to delete. Quit Xcode first, move the folder to the Trash, and Xcode rebuilds what it needs the next time you build. Nothing you wrote lives there.
- Path
~/Library/Developer/Xcode/DerivedData- What it is
- Build products, indexes and logs for each Xcode project
- Typical size
- Often several gigabytes, and tens of gigabytes if you open many projects
- Made by
- Xcode
- Safe to delete?
- Safe to clear
- Comes back?
- Yes. The next build recreates it, so the first build afterward is slower
What is in this folder?
Each project you open in Xcode gets its own subfolder named after the project plus a long hash. Inside are the compiled app, intermediate object files, the code index that powers search and autocomplete, and build logs. Apple's Xcode help describes derived data as project indexes, logs and build products, including intermediate build files.
Because every project and every scheme adds its own copy, the folder keeps growing. Projects you deleted years ago can still have a subfolder here.
Is it safe to delete?
Yes. DerivedData is a cache of work Xcode can redo from your source code. Your code, assets and signing settings live in the project, not here. The cost of deleting it is time: the next build recompiles everything, and Xcode re-indexes the project before autocomplete is fully back.
Delete it when Xcode is quitting, not while a build runs. Clearing it mid-build breaks that build. It also fixes odd problems such as stale module caches, which is why it is the classic first step when a build fails for no clear reason.
How do I clear it by hand?
- Quit Xcode, and stop any
xcodebuildrun or CI job on this Mac. - Open Terminal and run the command below, or press Shift-Command-G in Finder, paste the path and drag the folder to the Trash.
- Open your project and build. The first build is slow; later ones are normal.
rm -rf ~/Library/Developer/Xcode/DerivedDataOnly run this with Xcode closed. To remove a single project, delete just its subfolder instead of the whole folder.
How do I stop it growing?
Xcode has no size cap for DerivedData. Clearing it every few months, or deleting the subfolders of projects you no longer have, keeps it small. You can also point it at another drive in Xcode Settings under Locations.
How Clean House handles it
Clean House recognizes DerivedData as Xcode build files and labels each subfolder with the project it belongs to, noting when that project no longer exists on the Mac. It holds off while Xcode or a build is running, and the folder goes to the Trash, so Recently Cleared can put it back.