Diskzyv0.1
Safe to delete

What is DerivedData on Mac, and is it safe to delete?

Short answer

Yes, DerivedData is safe to delete. It only contains files Xcode generated from your source code, and Xcode recreates them the next time you open and build a project.

Where it is

~/Library/Developer/Xcode/DerivedData

What it is

DerivedData is Xcode's working folder. For each project or workspace you open, Xcode creates a subfolder holding intermediate build files, compiled products, the code index used for autocomplete and jump to definition, logs, and Swift package checkouts.

It grows because every project gets its own folder and nothing removes it when you stop working on that project. Old projects, experiments and cloned sample code all leave their build output behind.

Deleting DerivedData is also a common fix when Xcode shows stale errors or a build behaves strangely.

How big it gets

Often several GB, and tens of GB on a Mac used for regular app development.

How to clear it by hand

  1. Quit Xcode so it is not writing to the folder.
  2. In Finder, choose Go > Go to Folder and enter ~/Library/Developer/Xcode/DerivedData.
  3. Move the project folders you no longer need to the Trash, or remove everything with the command below. The command deletes the whole DerivedData folder, which Xcode creates again by itself.
  4. Empty the Trash if you used Finder.
In Terminal
rm -rf ~/Library/Developer/Xcode/DerivedData

What happens afterwards

The next build of each project is a full build, so it takes longer than usual, and Xcode re-indexes the project and resolves Swift packages again. Your source code and project settings are not touched.

How Diskzy handles it

Diskzy lists DerivedData in the Clean up tab and ticks it, unless Xcode is open, in which case it is left alone.

Related guides

See where your Mac's space went

Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.

Try Diskzy for free
Read this in:EnglishEspañolDeutschPortuguêsFrançaisTürkçe日本語