Skip to content
86% off$349 $48.86code BF2026

Guides

Xcode DerivedData: Delete Safely and Free Space on Mac

Deleting Xcode DerivedData is safe. Here is what else you can clear on a developer Mac, with paths, safety labels, commands and what each one costs you.

GuideUpdated 6 min read

On this page

You searched for whether it is safe to delete DerivedData and free space on your Mac. DerivedData is only one of several developer folders that grow quietly: simulator caches, old runtimes, Homebrew downloads, npm and pip caches, node_modules. This guide covers each one, what it costs you to clear, and what to leave alone.

Why developer folders get so big

Build tools cache aggressively because rebuilding and re-downloading is slow. Nothing cleans those caches for you, and they live in hidden or rarely opened places such as ~/Library/Developer, ~/Library/Caches and dot-folders in your home directory.

Most of it is regenerated data. "Safe" here means regenerated, not free: a cleared npm or Gradle cache means a slower next install, and a cleared DeviceSupport folder means a wait the next time you plug that device in. A few items are different: Xcode Archives, the pnpm store and Docker's disk image need a decision or a different tool.

Which folders are safe to delete

The last column uses the safety labels Gigabroom shows for the same locations.

ItemPathSafe to delete?What happens afterwardGigabroom label
Xcode DerivedData~/Library/Developer/Xcode/DerivedDataYesXcode rebuilds it; next build is slowerRegenerates
SwiftUI Previews~/Library/Developer/Xcode/UserData/PreviewsYesRecreated when you open a previewRegenerates
Simulator caches~/Library/Developer/CoreSimulator/CachesYesCoreSimulator recreates themSafe
iOS DeviceSupport~/Library/Developer/Xcode/iOS DeviceSupportYes, with a costSymbols copied again when that device connectsRegenerates
watchOS DeviceSupport~/Library/Developer/Xcode/watchOS DeviceSupportYes, with a costCopied again when the watch connectsRegenerates
Homebrew cache~/Library/Caches/HomebrewYesBottles download again when neededSafe
node_modulesnext to package.jsonYesReinstall from the lockfileRegenerates
Xcode Archives~/Library/Developer/Xcode/ArchivesThink firstNeeded to symbolicate crash reports of shipped buildsReview
pnpm store~/Library/pnpm/storeThink firstProjects hard-link into itReview
Docker disk image~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawNever trash itFree space from inside DockerReview, report only

Before you start

  1. Quit Xcode and stop running builds and simulators.
  2. See what is actually big. This only reads sizes and changes nothing:
bash
du -sh ~/Library/Developer/* 2>/dev/null

Step-by-step fixes

Clear DerivedData with Finder

  1. In Finder, choose Go > Go to Folder… (Command-Shift-G).
  2. Type ~/Library/Developer/Xcode/DerivedData and press Return.
  3. Select everything inside (⌘A) and move it to the Trash (⌘⌫).
  4. Empty the Trash.

Delete the contents, not the folder itself. The same route works for any cache folder in the table.

Clear old simulators and runtimes

Two things take space: simulator devices whose runtime is gone, and the runtimes themselves.

  1. To delete simulators whose runtime no longer exists (permanent):

    bash
    xcrun simctl delete unavailable
  2. For runtimes, open Xcode and go to Xcode > Settings > Platforms, then remove the ones you no longer test against.

  3. Terminal also offers xcrun simctl runtime delete <id>, where <id> is the runtime's identifier.

Clear package-manager caches

Most tools have their own cleanup command, which is better when you want to trim rather than wipe:

  • Homebrew: brew cleanup removes old downloads and outdated versions. brew --cache shows where the cache lives (by default ~/Library/Caches/Homebrew).
  • pnpm: pnpm store prune removes packages no project uses. Use it instead of trashing the store.
  • Docker: docker system prune frees space from inside Docker. Read Docker's pruning documentation first, and never trash the disk image file.

If you would rather not use each tool's command, these cache folders are fine to move to the Trash in Finder:

CachePath
Swift Package Manager~/Library/Caches/org.swift.swiftpm
CocoaPods~/Library/Caches/CocoaPods
npm~/.npm/_cacache
Yarn~/Library/Caches/Yarn
pip~/Library/Caches/pip
Gradle~/.gradle/caches
Cargo~/.cargo/registry/cache
Go build cache~/Library/Caches/go-build

Do it in one pass with Gigabroom

Checking a dozen hidden folders by hand is the tedious part. Gigabroom's Developer Junk screen measures these locations and labels each Safe, Regenerates or Review, with the reason beside it. Everything goes to the Trash after a confirmation, and your files are never sent to us. We make Gigabroom, and the Finder and Terminal methods above work fine for one folder. Gigabroom needs macOS 14 Sonoma or later.

  1. Open Gigabroom and choose Developer Junk under Clean in the sidebar (⌘7).
  2. Wait for the measurements. The header shows how much "can be swept"; the rest is report-only.
  3. Review the sections: Xcode, Simulators, Package Manager Caches, Project Dependencies, AI Models & Caches and Containers & VMs.
  4. Tick what you want. Only Smart-Scan-eligible sections start selected; Review and report-only items are never pre-selected.
  5. Click Sweep X and confirm "Sweep N developer items to the Trash?". Quit Xcode and running builds first.
  6. Empty the Trash to get the space back (File > Empty Trash…, ⇧⌘⌫).

What it adds over the manual routes:

  • Reasons. Archives are tagged Review ("Needed to symbolicate crash reports of builds you shipped"). The pnpm store is tagged Review and points to pnpm store prune.
  • Copyable commands for report-only items. The Docker disk image and unused simulator runtimes are never trashed. Gigabroom shows docker system prune or xcrun simctl runtime delete <id> for you to copy, and never runs them itself.
  • node_modules per project, with "touched X ago". Only one next to a package.json, inside your home folder and not nested can be trashed, and it is never pre-selected. If the Disk Map doesn't cover your home folder, it searches home up to 6 levels deep for folders of at least 5 MB, skipping Library and hidden folders.
  • Undo. Edit > Undo Sweep (⌘Z) puts items back. The last 20 sweeps stay undoable in the current session.
  • Smart Scan, the shorter route, queues only Safe and Regenerates items and stops at a confirm sheet. It never queues Archives, DeviceSupport, the pnpm store, Docker, node_modules or AI models.

Gigabroom is part of MacSuite: $349 one-time as of November 2026, with a 7-day free trial for each app. See the Developer Junk docs or the Gigabroom page.

Which method to pick

MethodBest forLimit
FinderOne folder, no new softwareYou must know every path; space returns only after you empty the Trash
TerminalTrimming without wipingOne tool at a time; most commands are permanent
GigabroomSeeing everything at once, with labels and UndoPart of a paid bundle after the trial

Checklist before you delete

  • Xcode, builds and simulators are closed.
  • You are clearing contents, not the parent folder.
  • Archives are kept if you still support those releases.
  • Docker.raw and the pnpm store are untouched.
  • You plan to empty the Trash afterward.

If nothing works

The space did not come back. Moved files stay in the Trash and still use space. Empty it. If free space still looks low, read Mac storage not going down after deleting files and what purgeable space is. After Empty Trash, Gigabroom reports the measured change; if much less was freed than expected, macOS may keep a copy in a local snapshot for a while (see System Data and snapshots).

The Simulators section is thin. Gigabroom lists simulator details only when ~/Library/Developer/CoreSimulator exists and xcode-select -p succeeds. Otherwise it shows "Simulator details need Xcode (xcrun simctl). Simulator caches are still listed."

An AI cache row says the app is open. Quit the app and measure again.

Gigabroom refuses an item with "Gigabroom won't trash “name”: it's a protected system, account or cloud location." Pick the items inside the folder instead.

If it still fails, contact MacSuite support with this:

text
Gigabroom 1.0.0 on macOS (your version). Developer Junk shows (exact message).
Steps tried: quit Xcode, measured again, emptied the Trash.
Free space before and after: (numbers). Screenshot attached.

Common questions

Will deleting DerivedData break my projects?

No. It holds build products and indexes, not your source. Xcode rebuilds both.

Does DerivedData come back right away?

Xcode writes to it on every build, so it grows again after you build. That is normal. The first build after clearing is slow while indexes regenerate.

Is it safe to delete Xcode Archives?

Only if you no longer need crash symbolication for builds you shipped. Keep recent releases.

Why can't I just delete Docker.raw?

It is Docker's virtual disk. Free space from inside Docker with docker system prune.

For more, see free up disk space on a Mac for developers and how to clear the Xcode cache.

Every app.
One purchase.