1. Delete DerivedData
DerivedData holds build products, indexes and logs for every project you have opened. Quit Xcode, then either open Xcode › Settings › Locations and click the arrow next to the DerivedData path, or run:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Your projects and source code are not touched. Deleting DerivedData is also a common fix for odd build errors.
2. Remove device support for old iOS versions
When you connect a device, Xcode copies its debug symbols to ~/Library/Developer/Xcode/iOS DeviceSupport (with similar folders for watchOS and other platforms). Each version can take several gigabytes. Delete folders for versions you no longer debug; Xcode copies them again if you connect a device running that version.
3. Clean up simulators and runtimes
Remove simulators that belong to runtimes you no longer have installed:
xcrun simctl delete unavailable
Simulator runtimes themselves are large. In recent versions of Xcode, manage them in Xcode › Settings › Components, or list them in Terminal with xcrun simctl runtime list and delete the ones you don't need.
4. Clear SwiftUI preview data
Previews keep their own simulator data in ~/Library/Developer/Xcode/UserData/Previews. It is rebuilt the next time you open a preview.
5. Clear package manager caches
These caches only speed up downloads, and each tool has its own command:
- npm:
npm cache clean --force - Homebrew:
brew cleanup - CocoaPods:
pod cache clean --all - pip:
pip cache purge - Swift Package Manager: its cache lives in
~/Library/Caches/org.swift.swiftpm - Gradle (Android): its cache lives in
~/.gradle/caches
The next install or build downloads what it needs again.
6. Be careful with Archives
~/Library/Developer/Xcode/Archives holds the builds you exported or uploaded, including their dSYM debug symbols. You need those to read crash reports from released versions. Delete old archives only for versions nobody uses anymore, or copy them to another drive first. In Xcode, manage them in Window › Organizer.
7. Local AI models
Tools that run AI models on your Mac can store several gigabytes per model, usually in a hidden folder in your home folder or in Application Support. Remove models from inside the tool you downloaded them with, so it stays in sync.
Where TheCleanDisk helps
TheCleanDisk has a Dev Tools section that finds DerivedData, device support, simulators and package caches, shows which projects still exist, and marks rebuildable data as Safe. Everything goes to quarantine first, so you can undo for 7 days. The space is fully freed when quarantine empties, or sooner if you empty it yourself. It is coming soon to the Mac App Store.