Developer•5 min read•Sep 2, 2026

How to Safely Clear 50+ GB of Xcode DerivedData and Archives in 2026

Elena Rostova
Principal macOS Engineer

Quick answer

Quit Xcode, then delete everything inside ~/Library/Developer/Xcode/DerivedData — it is a rebuildable cache, so the only cost is a slower next build. Keep Archives (~/Library/Developer/Xcode/Archives) for builds you have shipped, since they are needed to symbolicate crash reports, and run `xcrun simctl delete unavailable` to remove simulators for runtimes you no longer have.

1. What is Xcode DerivedData?

When building apps in Xcode for iOS, macOS, watchOS, or visionOS, the build system creates intermediate object files, precompiled headers, module cache indices, and build logs in:

~/Library/Developer/Xcode/DerivedData

When you edit a single Swift file, Xcode reuses existing object artifacts for fast incremental builds. However, Xcode never deletes old build directories for branches you have merged, renamed, or deleted. Over months of active development, this directory balloons uncontrollably.

2. Why Xcode Storage Grows Uncontrollably

Beyond DerivedData, Xcode maintains several other large cache directories that standard macOS uninstaller tools miss:

  • Archives (~/Library/Developer/Xcode/Archives): Every release or TestFlight build creates a bundle with full dSYM debugging symbols (often 1–5 GB each).
  • iOS DeviceSupport (~/Library/Developer/Xcode/iOS DeviceSupport): Symbols from every connected physical iPhone and iPad running different iOS versions.
  • CoreSimulator Devices (~/Library/Developer/CoreSimulator/Devices): Virtual disk images for each simulator runtime.
  • Swift Package Manager Caches (~/Library/Caches/org.swift.swiftpm): Cloned git repositories and compiled dependencies.

3. Safe Terminal Cleanup Commands

You can manually purge these caches using the macOS Terminal. Make sure Xcode is closed before running these commands:

# 1. Close Xcode completely
killall Xcode 2>/dev/null || true

# 2. Clear all DerivedData build intermediates
rm -rf ~/Library/Developer/Xcode/DerivedData/*

# 3. Clean unavailable CoreSimulator runtime devices
xcrun simctl delete unavailable

# 4. Remove Swift Package Manager caches
rm -rf ~/Library/Caches/org.swift.swiftpm

4. Safely Managing Xcode Archives

Archives cannot simply be wiped wholesale if you need dSYMs to symbolicate historical production crash reports. Instead, inspect your archives in Xcode via Window > Organizer or use CleanYourMac Space to filter archives by creation date and project identifier.

Automate with CleanYourMac Space

CleanYourMac Space provides a dedicated Developer Storage Mode that automatically classifies DerivedData by last-accessed date, groups iOS Simulators by runtime, and safely stages all deletions with 100% Trash-first rollback safety.

Skip the Terminal: see it all in one scan

CleanYourMac Space maps every cache, build folder and model file by size, then cleans only what you pick — everything goes to the Trash first, so it's always recoverable.