How to Clean Xcode DerivedData &
Free Up Gigabytes on Your Mac

If you build iOS or macOS apps for a living, Xcode is probably the single biggest contributor to disk bloat on your machine — far ahead of movies, music, or anything else. DerivedData, old Archives, orphaned Simulator runtimes, and stale device support files routinely pile up to 30–80 GB without a single warning. This guide walks you through exactly what each folder is, which ones are safe to delete right now, and how TrimyMac's Xcode Artifacts category can automate the entire process going forward.

What Is DerivedData — and Why Does It Keep Growing?

Every time you build a target in Xcode, the compiler produces a large amount of intermediate output: compiled object files (.o), Swift module interfaces (.swiftmodule), pre-compiled headers, dependency graphs, index-store data for code completion, and the final linked binary. Rather than mixing these outputs with your source tree, Xcode stores all of them in a separate cache directory called DerivedData.

The idea is smart: by caching intermediate build products, Xcode can perform incremental builds — only recompiling files that have actually changed since the last build. On a large project with hundreds of Swift files, this can cut a full rebuild from several minutes down to a few seconds.

The problem is accumulation. Xcode creates a new subdirectory for every project it has ever opened, named with the project name plus a hash of its location on disk. If you rename a project, move it to a different folder, or clone a fresh copy from Git, Xcode creates a brand-new DerivedData folder rather than reusing the old one. The orphaned folder is never cleaned up automatically. Over months and years of active development, it is completely normal to find DerivedData directories for dozens of projects you no longer work on — or even no longer have on your machine.

Key Insight
Every build adds to DerivedData. Every project move, rename, or Git clone creates a new entry. Old entries are never automatically removed. A developer who has worked on macOS for two or more years can easily accumulate 20–40 GB in this single folder.

Where DerivedData Lives

By default, DerivedData is stored at:

~/Library/Developer/Xcode/DerivedData/

You can confirm — or change — this location in Xcode under Xcode → Settings → Locations → Derived Data. Unless you have explicitly moved it, it will be at the default path above. Inside, you will find one or more subdirectories named after your projects, for example:

~/Library/Developer/Xcode/DerivedData/
  MyApp-abcdefghijklmnop/
  MyApp-qrstuvwxyz012345/     ← same project, different path
  OldClient-hjklmnopqrst/
  SomeOpenSourceLib-uvwxyz/

Each of those subdirectories can be anywhere from a few hundred megabytes for a small app to several gigabytes for a large project with many targets, frameworks, and test plans.

The Full Map of Xcode's Hidden Disk Usage

DerivedData is the biggest offender, but it is far from the only one. Here is a complete picture of every location Xcode uses to store data on your Mac, how large each one typically grows, and whether it is safe to delete.

Path Typical Size What It Stores Safe to Delete?
~/Library/Developer/Xcode/DerivedData 10 – 40 GB Build intermediates, index store, compiled binaries, test results Safe
~/Library/Developer/Xcode/Archives 2 – 20 GB Release builds exported for distribution via App Store or Ad Hoc Keep Recent
~/Library/Developer/CoreSimulator/Caches 5 – 25 GB Simulator disk images, runtime data, app installs inside simulators Unused Safe
~/Library/Developer/CoreSimulator/Devices 5 – 20 GB Virtual device data for every simulator you have ever booted Unused Safe
~/Library/Developer/Xcode/iOS DeviceSupport 2 – 15 GB Debug symbols for every iOS version you have connected a device running Old Versions Safe
~/Library/Developer/Xcode/watchOS DeviceSupport 1 – 5 GB Debug symbols for Apple Watch versions Old Versions Safe
~/Library/Caches/com.apple.dt.Xcode 500 MB – 5 GB Xcode application cache, downloaded components Safe

DerivedData: Safe to Delete? Absolutely Yes.

This is the most common question developers ask, and the answer is unambiguous: DerivedData is entirely safe to delete at any time. It contains no source code, no project configuration, no signing certificates, and nothing that cannot be regenerated automatically.

When you delete DerivedData and open your project in Xcode again, Xcode will simply rebuild from scratch the next time you press Cmd+B. Your first build after deletion will take longer than usual — equivalent to a clean build — but all subsequent incremental builds will be as fast as before as the cache is repopulated.

Developer Tip
Many experienced iOS developers delete DerivedData as a first troubleshooting step whenever they encounter strange build errors, red squiggles on code that is actually correct, or code completion returning stale results. A clean DerivedData is often the fastest fix.

Xcode Archives: Keep the Ones That Matter

Archives are different. Located at ~/Library/Developer/Xcode/Archives, each archive is a self-contained snapshot of a release build, complete with the compiled binary, its dSYM symbol file, and entitlements. Archives are what you upload to App Store Connect and what App Store Connect uses to create your app's distribution binary.

The dSYM (debug symbols) inside an archive are critically important: if a crash report comes in from a user running a version you shipped six months ago, the only way to symbolicate that crash — to turn raw memory addresses into readable function names and line numbers — is to have the matching dSYM for that exact binary. Without it, crash reports are unreadable.

Warning — Don't Delete Blindly
Before deleting any Archive, confirm that you either (a) still have the dSYM files backed up somewhere else, or (b) are certain you will never need to symbolicate crashes for that app version. A good rule: keep the last two major release Archives for every active app, and delete everything older.

Archives from discontinued projects, internal prototypes that were never shipped, or Xcode's automatic archives from running on a physical device in debug mode are almost always safe to remove.

iOS Simulator Data: The Hidden Storage Hog

The iOS Simulator is essentially a full virtual iPhone or iPad running on your Mac. Every simulator device you have ever booted — and there are often dozens, spanning multiple iOS versions and device types — maintains its own virtual disk image stored under ~/Library/Developer/CoreSimulator.

This directory has two major components:

CoreSimulator/Devices

Each virtual device has its own UUID-named folder here. If you have ever run a simulator for iPhone 13, iPhone 14, iPhone 15, iPhone 15 Pro, iPad Pro, and various iOS versions from 15 through 18, that is easily 30 or more virtual devices. Each one stores installed apps, sandboxed app data, and system state. On a machine that has been in active use for two or three years, this folder alone can exceed 15 GB.

CoreSimulator/Caches

This folder stores disk images for simulator runtimes. If you have ever downloaded an older runtime to test an edge case on iOS 15 or iOS 16, those disk images remain on disk permanently unless manually removed. A single simulator runtime image (e.g., "iOS 15.5 Simulator") can be 3–7 GB on its own.

You can safely delete simulators for iOS versions you no longer test against. Xcode will prompt you to re-download the runtime if you ever need it again.

iOS DeviceSupport: Symbol Files for Every iOS Version

Stored at ~/Library/Developer/Xcode/iOS DeviceSupport, this folder contains a complete copy of the debug symbol libraries (.dylib files) for every iOS version you have ever connected a physical device running. Xcode downloads these the first time you plug in a device running a new iOS version, and they are used for on-device debugging.

A single iOS version's symbol set is typically 1–2 GB. If you have connected devices running iOS 14, 15, 16, 17, and 18 (plus minor versions), you can easily have 10–12 GB of symbol files. The ones you do not need are for iOS versions you no longer debug against — typically anything more than two major versions old. Deleting them forces Xcode to re-download them if you connect a device running that version again, but for most developers that never happens.

Manual Cleanup Steps: Exact Commands

You can clean all of these locations manually from the Terminal. Here are the exact steps, in the safest order:

  1. Quit Xcode first Always quit Xcode before deleting any of these directories. If Xcode is writing to DerivedData during a build when you delete it, you may get a corrupted build state.
  2. Delete DerivedData entirely This is the safest and highest-impact action. Run the following command in Terminal: rm -rf ~/Library/Developer/Xcode/DerivedData
  3. Use Xcode's built-in cleaner for Simulators Open Xcode, go to Window → Devices and Simulators, select any simulator you no longer need, and click the minus (−) button. Alternatively, run: xcrun simctl delete unavailable
  4. Delete old iOS DeviceSupport versions Open Finder, press Cmd+Shift+G, paste the path, then manually delete folders for iOS versions you no longer support: ~/Library/Developer/Xcode/iOS DeviceSupport
  5. Review and selectively remove old Archives In Xcode, open Window → Organizer → Archives. Right-click any archive you no longer need and choose Show in Finder, then delete it there. Or navigate directly to: ~/Library/Developer/Xcode/Archives
  6. Clear the Xcode application cache Less impactful but still worth doing: rm -rf ~/Library/Caches/com.apple.dt.Xcode
How much space will you recover?
On a Mac that has been used for active iOS/macOS development for two or more years without any cleanup, it is common to recover 30–60 GB from the steps above. The biggest single wins are typically DerivedData (10–40 GB) and Simulator data (5–25 GB).

Automate This with TrimyMac's Xcode Artifacts Category

Doing this manually every few months works, but it requires you to remember to do it and to navigate through multiple directories. TrimyMac's Xcode Artifacts category handles all of this automatically, with an important distinction: it knows which files are safe to delete and which to leave alone.

When you run a scan in TrimyMac, the Xcode Artifacts category:

  • ✓ Scans all DerivedData subdirectories and identifies how much space each project is consuming, so you can clean selectively or all at once
  • ✓ Detects orphaned DerivedData entries for projects that no longer exist at their original path on disk
  • ✓ Lists unused Simulator devices and runtimes grouped by iOS version, so you can remove entire runtime families with a single click
  • ✓ Flags old iOS and watchOS DeviceSupport folders for versions more than two major releases behind the current SDK
  • ⚠ Always marks Archives as review before delete — TrimyMac will never automatically remove distribution Archives without explicit confirmation

The result is that a full Xcode cleanup that would take 10–15 minutes of manual Terminal work takes about 30 seconds in TrimyMac: run scan, review the Xcode Artifacts breakdown, confirm, done.

Clean Your Xcode Artifacts in 30 Seconds

TrimyMac finds orphaned DerivedData, old Simulator runtimes, and stale device support files — and removes them safely with one click.

Download TrimyMac Free

Free tier available · No account required · macOS 14 Sonoma or later

Frequently Asked Questions

Is it safe to delete DerivedData?

Yes, completely safe. DerivedData is a build cache — it contains only files that Xcode generated from your source code. It contains no source files, no project configuration, no signing certificates, and nothing irreplaceable. Deleting it will cause your next build to take longer than usual (a full clean build rather than an incremental one), but Xcode will recreate everything automatically. Many developers delete DerivedData regularly as routine maintenance or whenever they encounter mysterious build issues.

Does deleting DerivedData slow down Xcode permanently?

Only temporarily, for one build cycle. The first build after deleting DerivedData will be a full clean build and will take as long as a fresh checkout would. After that single build, the cache is repopulated and all subsequent incremental builds return to normal speed. On a fast Mac, even the penalty build is usually only a few minutes for medium-sized projects. The disk space savings — often 10–40 GB — far outweigh this minor one-time cost.

How do I delete iOS Simulators to free up space?

There are two ways. From within Xcode: open Window → Devices and Simulators, switch to the Simulators tab, select any simulator you want to remove, and click the minus (−) button at the bottom of the list.

From Terminal, you can remove all simulators that are no longer associated with an installed runtime (the safest automated option) by running: xcrun simctl delete unavailable

If you want to remove entire runtime downloads (e.g., the full iOS 15 Simulator runtime, which can be several gigabytes), go to Xcode → Settings → Platforms and click the minus button next to any runtime you no longer need. TrimyMac's Xcode Artifacts scan also lists all installed runtimes with their sizes so you can remove them in one place.

What is DerivedData in Xcode and what does it contain?

DerivedData is the folder where Xcode stores all output produced during a build. This includes compiled object files (.o), Swift module interface files (.swiftmodule), pre-compiled header caches, the index store used for code completion and jump-to-definition, linked product binaries, and test result bundles. Xcode keeps a separate DerivedData subfolder for every project it has ever built, named with the project name and a hash of its location on disk. Because old entries are never automatically cleaned up, the folder grows indefinitely over time.

Can I delete Xcode Archives?

It depends on which ones. Archives you should keep: the last one or two release Archives for any app that is currently live on the App Store, because each archive contains a dSYM file that you need to symbolicate crash reports from users running that app version.

Archives you can safely delete: Archives from projects that have been discontinued, internal prototype builds that were never distributed, debug archives, and any release that is old enough that you no longer receive crash reports for it or maintain that major version.

Before deleting any Archive, open it in Xcode Organizer (Window → Organizer → Archives) and check whether you want to export and separately back up the dSYM file first.

How do I free up space from Xcode on my Mac?

The fastest way to free up significant space from Xcode is to delete DerivedData (rm -rf ~/Library/Developer/Xcode/DerivedData), remove unused Simulator runtimes via Xcode Settings → Platforms, and delete old iOS DeviceSupport folders from ~/Library/Developer/Xcode/iOS DeviceSupport for versions you no longer test against. Together, these steps commonly recover 20–60 GB on a developer Mac that has been in active use for a year or more. TrimyMac's Xcode Artifacts category automates the entire scan and cleanup in a single step, while flagging Archives for manual review so you never accidentally delete a distribution build you still need.

Will deleting DerivedData fix Xcode build errors?

Often, yes. A stale or corrupted DerivedData folder is one of the most common causes of Xcode build problems that appear to have no logical explanation — things like "Cannot find type X in scope" on code that compiles fine on a colleague's machine, red squiggles on valid syntax, missing autocomplete, or builds that fail immediately without a clear error. Deleting DerivedData forces Xcode to start fresh, which resolves these issues in the majority of cases. It is the first thing most experienced iOS developers try when a project starts behaving strangely.