Where Xcode's space goes
- DerivedData (
~/Library/Developer/Xcode/DerivedData): build products and indexes. Safe to delete; Xcode rebuilds on the next build. - Archives (
~/Library/Developer/Xcode/Archives): builds you archived for release. Keep the ones whose dSYMs you still need for crash logs. - iOS DeviceSupport: debug symbols for every iOS version you've plugged a device in with. Old versions are safe to delete.
- CoreSimulator (
~/Library/Developer/CoreSimulator): simulator devices and runtimes, often tens of GB.
With Terminal
rm -rf ~/Library/Developer/Xcode/DerivedData clears build data, and xcrun simctl delete unavailable removes simulators for runtimes you no longer have. Both are permanent: there's no Trash.
With Broom
Broom's Cleanup screen lists DerivedData, archives and device support with their sizes. DerivedData is selected for you because it's rebuildable. Simulators and old SDKs sit under Worth a look so you choose. Everything moves to the Trash, so you can undo a wrong guess.
It also catches the rest of a developer Mac: package manager caches, and build folders like node_modules, target, Pods and .build.
Questions
Is it safe to delete DerivedData?
Yes. Close Xcode first. The next build takes longer while Xcode rebuilds it.
Why is CoreSimulator so big?
Each simulator runtime is several GB, and each device keeps its own installed apps and data. Old runtimes pile up across Xcode updates.
Should I delete Xcode Archives?
Only ones you don't need. Archives hold the dSYM files used to symbolicate crash reports for that release.