DiskAtlas DiskAtlas
Download Free DMG
Developer Storage

How to Clean Xcode DerivedData, Caches & iOS Simulators on Mac

If you build iOS, macOS, or visionOS apps with Xcode, your SSD is almost certainly hiding 30 to 120 GB of stale intermediate build products, obsolete simulator runtimes, and module index files. Here is the definitive, safe cleanup blueprint.

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:

PATH
~/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 .o object files, .swiftmodule files, 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.
💡
Is it safe to delete DerivedData? Yes, 100% safe. Deleting DerivedData will never delete your source code or project configuration. Xcode will simply rebuild the cache from scratch next time you press ⌘B.

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:

ZSH / BASH TERMINAL
rm -rf ~/Library/Developer/Xcode/DerivedData/*

If you want to remove ModuleCache as well (recommended when encountering strange Swift compiler errors):

ZSH / BASH TERMINAL
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 Free

3. 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:

PATH
~/Library/Developer/CoreSimulator/Devices

Run Apple's built-in simctl utility to wipe all unavailable simulator devices instantly:

TERMINAL COMMAND
xcrun simctl delete unavailable

To purge all temporary files and caches generated by the simulator runtimes:

TERMINAL COMMAND
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:

PATH
~/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:

  1. Purge DerivedData every month or whenever Xcode displays bizarre build errors.
  2. Run xcrun simctl delete unavailable after every major Xcode update.
  3. 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.
Share this developer guide: