Guide · Xcode

How to delete Xcode DerivedData and free up space

DerivedData is the folder where Xcode keeps build output and indexes, at ~/Library/Developer/Xcode/DerivedData. It is safe to delete because Xcode rebuilds it on the next build, usually with a slower first compile of a few minutes. Quit Xcode, delete the folder, and you can free many gigabytes.

Why it gets big

Xcode creates a DerivedData folder for every project you open and never cleans up after projects you stopped using. Add simulators, device support files for every iOS version you have plugged in, and old archives, and ~/Library/Developer can pass 50 GB. It counts toward System Data.

How to clear it by hand

Quit Xcode first, then:

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

The next build recreates what it needs. Other Xcode folders, and what to do with them:

  • ~/Library/Developer/Xcode/iOS DeviceSupport (and watchOS, tvOS, visionOS): symbols copied from your devices. Safe to remove old versions; Xcode re-copies them when the device is connected.
  • ~/Library/Developer/CoreSimulator/Caches, ~/Library/Caches/com.apple.dt.Xcode and ~/Library/Developer/Xcode/DocumentationCache: caches, safe to remove.
  • Simulators that no longer work: xcrun simctl delete unavailable
  • ~/Library/Developer/Xcode/Archives: not a cache. Archives are what lets you symbolicate crash reports for shipped builds. Keep the ones you released.

How Berth handles it

Berth recognises each of these Xcode folders and gives them the verdict that fits:

  • Rebuilds itself: DerivedData, with the cost shown (about 3 minutes for the first build). Berth flags folders older than 60 days and builds whose project no longer exists.
  • Re-downloadable: DeviceSupport. Berth keeps the newest version and marks the rest.
  • Your call: Archives, because you may need them to symbolicate crash reports, and unused simulator runtimes.

Berth also clears unavailable simulators with xcrun simctl delete unavailable.

Whatever Berth finds goes into a review tray first. A dry run shows exactly what would move, pre-flight checks make sure the owning app is closed, and everything goes to the macOS Trash, so Undo puts it back. Berth is free to scan and explore; one-click cleanup is part of Berth Pro, $24 one-time for 2 Macs. There is no account and nothing is uploaded.

Questions

Is it safe to delete DerivedData?

Yes. It only holds build products and indexes that Xcode regenerates. You lose nothing but the time of one full build.

Will deleting DerivedData fix build errors?

Often, yes. Stale module caches are a common cause of odd errors, and a clean DerivedData forces a fresh build.

Can I delete Xcode Archives?

Only ones you no longer need. Archives hold the debug symbols for builds you shipped, and you need them to read crash reports.

Where is Xcode data counted in storage?

In System Data. Berth splits it out as Xcode build data and simulators.

Make room.
See what’s filling your Mac.

Free to scan, explore and understand everything on your disk. Berth Pro adds one-click cleanup when you want it.

Find my Xcode leftovers, free

Free download · Version 1.0.0 · Signed and notarized by Apple

Berth runs on macOS. Send yourself the link and open it there.