How to

How to safely delete Xcode DerivedData, Archives and Device Support

What lives in DerivedData, Archives and Device Support, what deleting each one costs you, and how to clean them on a Mac without losing what you need.

Free to scan. Seven days of cleaning free, no card. macOS 26 or later.

Xcode keeps three kinds of leftovers in ~/Library/Developer/Xcode. All three come back when they're needed. What differs is what you lose in the meantime.

DerivedData: safe to delete, costs you one full build

Where: ~/Library/Developer/Xcode/DerivedData

Every project you build gets its own folder here, holding build products, intermediates and the index. Xcode recreates a project's folder the next time you build it. So deleting it is safe, but the next build of that project starts from scratch, and indexing runs again.

There are also shared caches, such as ModuleCache.noindex. Every project uses them, and the next build fills them again.

Before you delete: quit Xcode. Deleting a folder while Xcode is building or indexing in it gives you confusing errors.

From the terminal:

See what's there and how big each folder is:

du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -h

Delete one project's folder (folder names are ProjectName-<random>):

rm -rf ~/Library/Developer/Xcode/DerivedData/MyApp-*

Delete everything:

rm -rf ~/Library/Developer/Xcode/DerivedData/*

If you only want a clean build of the project that's open, Product › Clean Build Folder (⇧⌘K) in Xcode is enough. It cleans that project's build products and leaves the other projects alone.

The folders that pay off most are the ones for projects you deleted or moved. Nothing will ever build them again.

Archives: check your dSYMs first

Where: ~/Library/Developer/Xcode/Archives, in dated subfolders

You get an archive each time you run Product › Archive. It holds the built app and its dSYMs, the debug symbols that turn a crash report's addresses into function names and line numbers.

This is the one folder that doesn't come back on its own. If you ship an app, deleting the archive for a build that's still in users' hands can leave you with crash reports you can't read, unless the dSYMs are kept somewhere else.

Before you delete:

  1. Confirm that your crash reporter (App Store Connect, Crashlytics, Sentry or another) already has the dSYMs for that build.
  2. Delete old archives from Xcode's Organizer (Window › Organizer › Archives), where each one is listed by app, version and build. You can also delete the dated folders in Finder.

Archives for builds that never shipped, or for versions nobody runs any more, are the safe ones to go first.

Device Support: safe, comes back when the device connects

Where: ~/Library/Developer/Xcode/iOS DeviceSupport, along with watchOS DeviceSupport, tvOS DeviceSupport and the matching folders for other platforms

When you connect a device for debugging, Xcode copies that OS version's symbols to your Mac, one folder per OS build. After a few years of updates you have a folder for every version you ever plugged in.

Deleting an old version's folder is safe. If you connect a device running that version again, Xcode copies the symbols again, which takes a few minutes the first time.

du -sh ~/Library/Developer/Xcode/*DeviceSupport/* | sort -h

Keep the folders for the versions on the devices you test on now. Delete the rest.

Xcode's own cache

~/Library/Caches/com.apple.dt.Xcode is a cache. Quit Xcode first, then you can delete it.

Quick reference

FolderComes back?What deleting it costs
DerivedData (a project's folder)Yes, on the next buildOne full build and a reindex
DerivedData (deleted or moved projects)Never neededNothing
ArchivesNoThe dSYMs for that build, unless they're stored elsewhere
Device Support (old OS versions)Yes, when that device connectsCopying the symbols again
com.apple.dt.Xcode cacheYesNothing much

Doing it with DevSweeper

DevSweeper lists DerivedData by workspace name rather than MyApp-dkxqzs…, marks folders whose project no longer exists, and lists archives by app, version and build, with a reminder to check your dSYMs. It moves everything to the Trash after showing you the exact paths, and it waits for Xcode to quit before cleaning DerivedData for a project that still exists, or Xcode's own cache. Scanning is free.

Sources: Xcode behaviour as described on devsweeper.com/xcode (read 2 Nov 2026); Apple: Building your app to include debugging information; Apple: Distributing your app.

More of what DevSweeper finds