Guides

Can you delete Xcode's DerivedData?

Yes. DerivedData only holds build products, indexes and logs that Xcode generates from your code. If you delete it, Xcode recreates it the next time you build. All you lose is time: the first build and indexing take longer.

Where it is and how big it is

By default it lives in:

~/Library/Developer/Xcode/DerivedData

You can also find it in Xcode under Settings → Locations, with an arrow that opens the folder in Finder. To see its size:

du -sh ~/Library/Developer/Xcode/DerivedData

With a few projects it’s normal for it to pass 10 GB, because Xcode keeps one folder per project and never removes the ones for projects you stopped opening.

How to delete it

  1. Quit Xcode.
  2. Open the folder in Finder (⇧⌘G and paste the path above).
  3. Move the subfolders to the Trash. You can delete only those for projects you no longer use, or all of them.

From Terminal, the equivalent is rm -rf ~/Library/Developer/Xcode/DerivedData/*, but that skips the Trash.

Other Xcode folders that take a lot of space

Summary

Folder Safe to delete? What you lose
DerivedData Yes Time on the next build
Unused simulators Yes Nothing, if you don’t use them
Old iOS DeviceSupport Yes Fetched again when you connect
Archives Carefully That version’s dSYMs

For everything else taking space on your Mac, see How to free up space on your Mac.