Guide
How to free up Xcode disk space on Mac
Xcode spreads what it uses across half a dozen folders, none of them obvious. On a Mac with eighteen months of work, 30 to 60 GB of recoverable space is normal. Here is what sits in each one, and which you can delete without thinking twice.
DerivedData — delete it, no fear
~/Library/Developer/Xcode/DerivedData
Almost always the biggest, and the safest to remove: intermediate build products, indexes and logs. Xcode rebuilds it on its own. The only cost is that the next build of each project takes longer.
Simulators — use simctl, never by hand
~/Library/Developer/CoreSimulator/Devices
Every simulator you boot keeps its own disk. How you delete them matters:
removing those folders directly leaves Xcode pointing at devices that no
longer exist. The correct way is xcrun simctl delete unavailable
for the unsupported ones, and xcrun simctl delete <UDID>
for specific devices.
iOS runtimes — several GB each
Every iOS version downloaded for the simulator weighs 5 to 8 GB. Run
xcrun simctl runtime list to see what you have. Always keep the
newest one and whichever your project requires.
iOS DeviceSupport — it re-downloads
~/Library/Developer/Xcode/iOS DeviceSupport
Symbols for every device and OS version you have ever plugged in. If that iPhone from 2019 is still on the list, its symbols are still there. They download again next time you connect that device.
Archives — careful here
~/Library/Developer/Xcode/Archives
Do not delete this blindly. It holds the signed builds you shipped to the App Store, with their debug symbols. Without them you cannot read crash reports from released versions. Only delete archives for versions you no longer support.
And everything that is not Xcode
If you also work with Node, Docker or Android, there is often just as much
there: node_modules scattered across your projects, unused
Docker images, the Gradle cache, the Cargo registry, CocoaPods. None of them
show up in the macOS Storage panel.
Doing it without the terminal
DevToolbox scans every one of those locations from the menu bar, tells you
what each weighs, and moves what you tick to the Trash. Simulators are
removed with simctl, the way it should be done.