If you build iOS, macOS, or visionOS software, your Mac's internal SSD is likely surrendering 30 GB to 80 GB of invisible storage to Xcode build artifacts. While Apple's integrated development environment is indispensable, its cache management routines are remarkably passive.
Why Xcode Consumes Massive Storage
Unlike transient browser caches that respect strict size ceilings, Xcode retains intermediary build objects indefinitely to accelerate future compilation cycles. Over months of switching git branches, pulling dependencies via Swift Package Manager, and running unit tests, these folders multiply exponentially:
- DerivedData (~15 - 45 GB): Intermediary object files, module maps, index stores, and symbol tables.
- Simulator Runtimes (~10 - 25 GB per OS version): Virtual disk images for outdated iOS, watchOS, and tvOS SDKs.
- iOS DeviceSupport (~10 - 30 GB): Symbolication files generated every time a physical iPhone or iPad connects via USB-C.
1. Safely Purging DerivedData
You can safely delete the contents of ~/Library/Developer/Xcode/DerivedData at any time. Xcode will simply rebuild whatever indexes it needs when you next open your project.
# Inspect current size
du -sh ~/Library/Developer/Xcode/DerivedData
# Safely purge all project build caches
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Pro-Tip: Quit Xcode prior to executing this terminal command to prevent file lock contention and indexer crashes.
2. Deleting Abandoned iOS Simulator Runtimes
Each major iOS update leaves lingering simulator containers. Use the native xcrun simctl command-line utility to identify orphaned simulators and purge unavailable runtime profiles:
# Erase all installed simulator caches & transient files
xcrun simctl erase all
# Delete all inaccessible / legacy simulator devices
xcrun simctl delete unavailable
3. Pruning DeviceSupport & Old Archives
When you plug in an iPhone running an older iOS version, Xcode caches its debug symbols in ~/Library/Developer/Xcode/iOS DeviceSupport. If you no longer debug on that specific iOS build, you can safely remove older subfolders to immediately free 2 GB to 5 GB per device.
Automating with MacPax Clean
Manually tracking down directories across ~/Library/Developer, ~/Library/Caches, and Swift Package Manager repos is tedious and error-prone. MacPax Clean includes a dedicated Developer Caches Module that scans Xcode, Android Studio, CocoaPods, and Homebrew with zero risk of deleting your project sources.