Open System Settings › General › Storage on almost any Mac used for iOS development and you'll see it: a grey bar called System Data, often bigger than your apps, your photos and your documents put together.
macOS doesn't tell you what's inside it. On a developer Mac, most of it is stuff Xcode and your tools left behind. Some of it is safe to delete, some of it will cost you an afternoon of re-downloading if you do. Here's the map.
1. Xcode DerivedData
~/Library/Developer/Xcode/DerivedData
Build products and indexes for every project you've ever opened. Xcode rebuilds it automatically, so it's always safe to delete. The only cost is that your next build of each project is a clean one.
2. Simulator runtimes
xcrun simctl runtime list
Every iOS, watchOS and visionOS version Xcode downloaded for the simulator. Each one is several gigabytes, and they pile up across Xcode releases. Remove old ones with xcrun simctl runtime delete <id>. You can always download them again from Xcode › Settings › Components.
3. Simulators (devices)
~/Library/Developer/CoreSimulator/Devices
Each simulated iPhone and iPad keeps its own apps and data. xcrun simctl delete unavailable clears the ones for runtimes you no longer have.
4. Device support files
~/Library/Developer/Xcode/iOS DeviceSupport
Xcode copies symbols from every physical device and iOS version you've connected. Old versions are safe to remove; Xcode re-copies them the next time you plug that device in.
5. Archives
~/Library/Developer/Xcode/Archives
Every build you archived for TestFlight or the App Store. Not regenerated, so keep the ones you shipped (you need their dSYMs to read crash reports). Old test archives can go.
6. Package manager caches
Homebrew (brew cleanup), npm (~/.npm), CocoaPods (~/Library/Caches/CocoaPods), Gradle (~/.gradle/caches), Swift Package Manager and others. All of these re-download on demand.
7. Logs and app caches
~/Library/Logs, ~/Library/Caches. Mostly safe, but clear them per app rather than wiping the whole folder.
8. Time Machine local snapshots
tmutil listlocalsnapshots /
macOS keeps local snapshots when your backup disk isn't connected. They show up as System Data and are deleted automatically when space runs low, but you can remove them yourself with tmutil deletelocalsnapshots /.
The quick version
| Folder | Safe to delete? | Comes back by itself? |
|---|---|---|
| DerivedData | Yes | Yes |
| Old simulator runtimes | Yes | Re-download if needed |
| Unavailable simulators | Yes | — |
| Old DeviceSupport | Yes | Yes, when you plug the device in |
| Archives you shipped | No | No |
| Package caches | Yes | Yes |
| Local snapshots | Yes | macOS manages them |
Doing it without Terminal
I got tired of running these commands by hand every few months, so I built a small Mac app for it: Mop. It scans all of the places above, shows what each item is and whether it comes back on its own, and pre-ticks only the safe ones. Anything that would cost you time goes to the Trash instead of being deleted, and it never touches your documents or source code.
On my own Mac it found 24.78 GB that was safe to remove, plus another 79 GB worth reviewing.
Scanning is free, and so is cleaning your first 2 GB. After that it's a one-time $9.99. (Full disclosure: I'm the developer.)
Whether you use Mop or the commands above, the main lesson is the same: on a developer Mac, "System Data" is mostly regenerable junk, and you can usually take back tens of gigabytes in a few minutes.
Top comments (0)