Apple's Xcode IDE is an incredible software suite, but it has a notorious reputation for silently devouring Mac storage. Because Xcode optimizes for fast incremental builds and indexing, it caches every compiled object file, LLVM module, and index symbol permanently without an aggressive default retention limit.
After several weeks of active development on a few projects, it is completely normal to find 50+ GB of Xcode DerivedData sitting inside your hidden ~/Library folder.
1. What is Xcode DerivedData?
DerivedData is Xcode's primary build cache. It lives at the following path on your Mac:
~/Library/Developer/Xcode/DerivedData
Inside this folder, Xcode creates a separate subfolder for every project and workspace you open (e.g. DiskAtlas-fkgvbtowekfhlgqow). Inside each project directory, Xcode stores:
- Build Products & Intermediates: Compiled
.oobject files,.swiftmodulefiles, and debug binaries. - Index Store: The syntax highlight database and code completion symbol graph.
- Module Cache: Precompiled Clang/Swift module interfaces.
- Logs & Diagnostics: Build and test activity history.
2. How to Safely Delete DerivedData
Method A: Terminal Command (Fastest for Developers)
You can instantly delete all DerivedData caches via your Terminal using the rm -rf command:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
If you want to remove ModuleCache as well (recommended when encountering strange Swift compiler errors):
rm -rf ~/Library/Caches/org.swift.swiftpm rm -rf ~/Library/Caches/com.apple.dt.Xcode
Method B: Automated Big Wins Cleanup with DiskAtlas
If you don't want to memorize obscure Unix paths or risk deleting the wrong directory, DiskAtlas for Mac automatically catalogs Xcode DerivedData, CoreSimulator devices, SPM caches, and Docker images under the Big Wins Reclaim panel.
With 1 click, DiskAtlas calculates the exact space and moves stale build artifacts safely to the macOS Trash, allowing instant recovery if desired.
Clean Xcode Bloat with 1 Click
DiskAtlas visualizes exactly which Xcode projects are consuming disk space with interactive treemaps and safe 1-click reclaim.
Download DiskAtlas Free3. Delete Unavailable iOS Simulators & Devices
Every time Xcode or macOS updates, old simulator runtimes (iOS 16, iOS 17) become orphaned or "unavailable," yet their container directories remain stored on disk in:
~/Library/Developer/CoreSimulator/Devices
Run Apple's built-in simctl utility to wipe all unavailable simulator devices instantly:
xcrun simctl delete unavailable
To purge all temporary files and caches generated by the simulator runtimes:
xcrun simctl erase all
4. Prune Xcode Archives & Device Support
When you create an app archive for App Store Connect or TestFlight (via Product → Archive), Xcode saves an uncompressed .xcarchive package containing full dSYMs and binary symbols.
Over years of releases, these archives easily total 20–50 GB. They are stored in:
~/Library/Developer/Xcode/Archives
You can safely delete archives for old app builds that have already been shipped and confirmed in App Store Connect.
5. Xcode Storage Breakdown Matrix
| Category | Directory Path | Typical Size | Safety Score |
|---|---|---|---|
| DerivedData | ~/Library/Developer/Xcode/DerivedData |
20 – 80 GB | 100% Safe |
| iOS Simulator Devices | ~/Library/Developer/CoreSimulator/Devices |
10 – 40 GB | 100% Safe (simctl) |
| SwiftPM / SPM Cache | ~/Library/Caches/org.swift.swiftpm |
5 – 25 GB | 100% Safe |
| Archives (.xcarchive) | ~/Library/Developer/Xcode/Archives |
15 – 60 GB | Safe (if shipped) |
| iOS DeviceSupport | ~/Library/Developer/Xcode/iOS DeviceSupport |
10 – 30 GB | Safe (Re-indexes on plug) |
Summary & Best Practices
To keep your Mac SSD running at peak performance:
- Purge DerivedData every month or whenever Xcode displays bizarre build errors.
- Run
xcrun simctl delete unavailableafter every major Xcode update. - Use DiskAtlas to monitor your SSD in real time from the menu bar and catch ballooning developer caches before your drive runs out of space.