How to free up disk space on a Mac: Xcode, simulators and the caches nobody sees
A Mac used for development fills up in a way that Finder never explains. The Storage panel says "System Data: 180 GB" and offers no button. Almost all of it sits in a handful of folders under ~/Library that Xcode, simulators and package managers keep growing. Here is where it goes and how to get it back.
Where the space goes
- Xcode DerivedData (~/Library/Developer/Xcode/DerivedData): build products and indexes for every project you ever opened. 20 to 60 GB is normal. Safe to delete at any time; Xcode rebuilds it.
- iOS DeviceSupport (~/Library/Developer/Xcode/iOS DeviceSupport): symbol files for every iOS version of every device you plugged in. Several GB per version. Keep only the versions you still debug on.
- Simulators (~/Library/Developer/CoreSimulator): each simulator runtime is 5 to 8 GB, and old runtimes stay after an Xcode update.
- Archives (~/Library/Developer/Xcode/Archives): every build you ever uploaded to App Store Connect, with its dSYMs.
- Caches (~/Library/Caches): Homebrew downloads, npm, pip, CocoaPods, Gradle and the browsers. These grow for years.
- Docker and Android: Docker.raw can reach 60 GB; the Android SDK keeps old system images and emulator snapshots.
Clean it by hand
Quit Xcode first. Then run these in Terminal, one at a time, and check what each prints before moving on.
rm -rf ~/Library/Developer/Xcode/DerivedData
xcrun simctl delete unavailable
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*
brew cleanup --prune=all
npm cache clean --force
docker system prune -a
Delete simulator runtimes you no longer need in Xcode → Settings → Platforms, and old archives in Window → Organizer (right-click → Show in Finder, then delete the .xcarchive bundles). Empty the Trash afterwards or the space is not released.
Do not delete ~/Library/Developer entirely while Xcode is running, and leave ~/Library/Application Support alone: app settings and licences live there.
Clean it in one click
Free My Disk is our macOS app that scans exactly these locations, shows the size of each category, and removes what you tick. It only offers simulator runtimes that no simulator device still references, so it does not break a working setup, and it has a Free RAM button for the other reason a developer Mac feels slow.
Keep it from filling up again
- Run a cleanup after each Xcode update: that is when the old simulator runtimes become dead weight.
- Set Xcode → Settings → Locations → Derived Data to Custom if you want it on an external drive.
- Check the Storage panel monthly. If System Data keeps climbing, it is almost always one of the folders above.