Home  ›  Articles

Deleting Xcode DerivedData, and the 40 GB Around It

Updated 2026-07-26  ·  3 min read

Every iOS developer eventually discovers ~/Library/Developer is consuming 50 GB. DerivedData gets the blame, but it is rarely the largest offender. Here is the full map.

Xcode is the single largest consumer of disk space on most developer Macs, and almost all of it is regenerable. The catch is that the folders differ in what they cost you to delete, one is free, one costs a long rebuild, and one costs a multi-gigabyte re-download.

The folders, by size and by risk

DerivedData, delete freely

~/Library/Developer/Xcode/DerivedData

Build products, module caches, and index data for every project you've ever opened. Typically 5–30 GB. Entirely safe to delete: Xcode rebuilds it. The only cost is that your next build is a full one, and the index has to rebuild before code completion and jump-to-definition work again.

Deleting DerivedData is also the standard fix for a whole class of nonsense Xcode errors, stale module caches, “no such module” when the module plainly exists, and phantom build failures that survive a clean.

iOS DeviceSupport, usually the biggest surprise

~/Library/Developer/Xcode/iOS DeviceSupport

Symbol files downloaded from every physical device you've ever plugged in, kept per iOS version. Each is 1–4 GB and they're never cleaned up. On a machine used for a few years this folder alone commonly holds 20–40 GB.

Safe to delete. The cost: the next time you connect a device running that iOS version, Xcode re-copies the symbols, which takes a few minutes.

Simulator runtimes and devices, big, deletable, but re-downloaded

~/Library/Developer/CoreSimulator/Devices

Every simulator you ever created, including ones from Xcode versions you've uninstalled. Each runtime is several gigabytes.

Prefer the supported route rather than deleting by hand:

xcrun simctl delete unavailable

That removes simulators whose runtimes no longer exist, the safest, highest-yield command in this entire article. To see what you've:

xcrun simctl list devices

Archives, check before you delete

~/Library/Developer/Xcode/Archives

This is the one to be careful with. Archives contain the dSYM files needed to symbolicate crash reports from builds you've already shipped. Delete the archive for a released build and you lose the ability to read its crash logs.

Delete old archives for builds that never shipped. Keep anything corresponding to a release.

The one-line version DerivedData and DeviceSupport: delete without thinking. Unavailable simulators: delete with simctl. Archives: check first, because shipped builds need their dSYMs.

Beyond Xcode

The same accumulation happens across every toolchain:

Every one of these regenerates. Collectively they routinely account for another 10–30 GB.

Reclaim all of it in one pass

CleanMachine's Developer Cache Cleaner finds Xcode, CocoaPods, npm, Gradle, pip, Homebrew and Docker caches together, shows the size of each, and lets you clear them selectively. Free to scan and see the totals.

↓ Download Free & Scan

A note on rm -rf

The usual advice is rm -rf ~/Library/Developer/Xcode/DerivedData/*. It works. Two cautions: quit Xcode first, or it'll rewrite state as you delete it; and be exact with the path, because a mistyped rm -rf in your home directory is unrecoverable. Moving the folder to the Trash is slower and strictly safer.

Common questions

Is it safe to delete DerivedData?
Yes. It contains build products and index data that Xcode regenerates. The only cost is a slower next build while the project rebuilds and reindexes.
What is the largest Xcode folder?
Usually iOS DeviceSupport or simulator runtimes rather than DerivedData. DeviceSupport keeps 1-4 GB of symbols per iOS version and is never cleaned automatically.
Should I delete Xcode Archives?
Only for builds you never shipped. Archives hold the dSYM files needed to symbolicate crash reports from released builds, delete those and you can't read crashes from that version.
How do I delete old simulators?
Run xcrun simctl delete unavailable. It removes simulators whose runtimes are gone, which is safer than deleting the CoreSimulator folder by hand.

Keep reading