How to clear Xcode DerivedData on a Mac
What DerivedData holds, how to see which project uses the most, Clean Build Folder versus deleting, and the simulators that take even more.
6 min read · Updated October 9, 2026
Every project you build in Xcode gets a folder in DerivedData: build products, intermediate files, the index that powers code completion, and logs. Apple's own help says the folder "is often large and can be re-created at any time from your source files." So it's safe to clear. The only cost is time: the next build starts from scratch and Xcode indexes the project again.
Where it lives
By default Xcode keeps DerivedData for all your projects in one place:
~/Library/Developer/Xcode/DerivedData
Each project gets a folder named after it with a random suffix, like MyApp-abcdefghijk. Next to them you'll find folders Xcode shares between projects, such as ModuleCache.noindex. You can change the location in Xcode's Settings, under Locations, by choosing Relative or Custom from the Derived Data menu. If you did, the folder is wherever that points. A build from the command line can use its own folder too, with xcodebuild -derivedDataPath.
Look before you delete
These commands only read:
# The whole folder
du -sh ~/Library/Developer/Xcode/DerivedData
# Each project, biggest last
du -sh ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null | sort -h
# Simulator devices and caches, often bigger than DerivedData
du -sh ~/Library/Developer/CoreSimulator/Devices ~/Library/Developer/CoreSimulator/Caches 2>/dev/null
Look for projects you no longer build. Their folders are the easiest win, and a project you deleted months ago still has its DerivedData until you clear it.
Clean Build Folder or delete?
For one project, Xcode's own way is Product > Clean Build Folder. It removes that project's build products and intermediate files, so the next build compiles everything again. The command-line version is xcodebuild clean, which removes build products and intermediates from the build root.
Clean Build Folder doesn't remove the project's whole DerivedData folder or the shared ones, and it does nothing for projects you no longer open. For those, delete the folder.
Apple's docs don't say whether deleting DerivedData while Xcode is open causes trouble. Quit Xcode first, or at least don't build while you do it. Builds started by coding agents count too: a Claude Code or Codex session that runs xcodebuild writes to the same folder.
Deleting by hand
Move what you no longer need to the Trash. The trash command comes with macOS 15 and later:
# Moves to the Trash: one project's DerivedData
trash ~/Library/Developer/Xcode/DerivedData/MyApp-abcdefghijk
# Moves to the Trash: all of it
trash ~/Library/Developer/Xcode/DerivedData
What you give up:
| Delete | You lose |
|---|---|
| One project's folder | That project's next build is a full build, and Xcode indexes it again |
| All of DerivedData | The same for every project, plus the shared module caches, rebuilt as needed |
Space moved to the Trash comes back only when you empty the Trash.
Simulators whose runtime is gone
Simulators often take more than DerivedData. Two commands from Xcode clean them up, and both are documented in xcrun simctl help:
# DELETES: simulator devices the current Xcode SDK no longer supports
xcrun simctl delete unavailable
# Lists simulator runtime images, then shows what would be deleted
xcrun simctl runtime list
xcrun simctl runtime delete --outdated --dry-run
--outdated picks runtimes that have a newer version with the same identifier. These flags come from Xcode 27's help; check xcrun simctl help runtime on your version. You can also remove runtimes and other components in Xcode's Settings, under Components, which shows how much space each one frees.
Doing it with Devbroom
Devbroom recognizes ~/Library/Developer/Xcode/DerivedData and ~/Library/Developer/CoreSimulator/Caches by their exact paths, and lists them with the other developer caches. Scanning only reads.
- DerivedData is Ready when nothing uses it: Xcode rebuilds it, and the next build takes longer. Devbroom says exactly that beside the item.
- It's Blocked while Xcode or a build is using it. If a process runs from the folder or holds a file in it open, the item waits, and it's ready again once that process exits.
- Simulators whose runtime is gone are listed as one item and removed with
xcrun simctl delete unavailable, Xcode's own command, not by deleting folders. Devbroom warns that apps and their data on those simulators go too, and since Xcode deletes them, they don't pass through the Trash. - A DerivedData folder inside a project, from a Relative location, is a build folder of its own, and is Ready only with Xcode's files inside.
Developer caches can be turned off in Settings. Folders you clean move to the Trash, and Put back returns it from History. The details are in Verdicts and Rules. Devbroom is free to download.
Related
- The other build folders on the same Mac: How to find and clean node_modules and build folders on a Mac.
- Another cache that grows with every install: How to clean the pnpm store on a Mac.
- A free app made only for Xcode's folders: Devbroom vs DevCleaner.
- Every developer cache Devbroom knows: Getting started.
More guides
- How to find and clean node_modules and build folders on a MacFind the biggest node_modules and build folders, check that each one can be rebuilt, and move them to the Trash instead of rm -rf.
- How to clean the pnpm store on a MacFind the store, spot the folder an old pnpm version left behind, prune what no project uses, and know why freed space can be less than du says.
- Where coding agents keep their data on a MacA folder-by-folder map of Claude Code, Codex, Cursor, OpenCode and Orca: what each folder holds and whether to clean it.
- How to free up disk space taken by Claude Code on a MacTranscripts, checkpoints, scratch folders and worktrees: what Claude Code keeps, what you can delete and what you should leave alone.