Reference / Fix an error

Xcode is out of disk space — what to clear

Reclaim 20+ GB safely · reversible

Xcode hoards tens of GB in DerivedData, archives, device-support, and simulators. Most rebuilds itself — here's the safe order to reclaim it.

30-second triage

See how full you are and what's safe to clear:

$ df -h / # how tight are you $ diskspace detect # rank the Xcode bloat $ diskspace explain ~/Library/Developer/Xcode/DerivedData # audit the big one

What's usually eating it

Each links to a plain verdict — does it come back if you delete it?

Is it safe to delete ~/Library/Developer/Xcode/DerivedData on a Mac?~/Library/Developer/Xcode/DerivedDataSafe to deleteIs it safe to delete ~/Library/Developer/Xcode/Archives on a Mac?~/Library/Developer/Xcode/ArchivesUsually safeIs it safe to delete ~/Library/Developer/Xcode/iOS DeviceSupport on a Mac?~/Library/Developer/Xcode/iOS DeviceSupportUsually safeIs it safe to delete ~/Library/Developer/CoreSimulator/Devices on a Mac?~/Library/Developer/CoreSimulator/DevicesUsually safe

The one-command fix

diskspace frees exactly what you need, pressure-tests every candidate against live disk state, and stages it reversibly — so an agent or a human can run it without fear.

$ brew install tymrtn/diskspace/diskspace $ diskspace doctor --need 20G --yes # scan → pressure-test → free