Home › Guides

How to delete Xcode DerivedData (and is it safe?)

Updated November 24, 2026

Short answer: yes, deleting DerivedData is safe. It only holds build products, indexes and logs that Xcode recreates on your next build. Quit Xcode, delete ~/Library/Developer/Xcode/DerivedData, and you'll typically get back 5–50 GB.

What is DerivedData?

Every time Xcode builds a project, it writes intermediate files — compiled objects, module caches, the code index used for autocomplete and "Jump to Definition", build logs and test results — into a folder per project inside ~/Library/Developer/Xcode/DerivedData.

Xcode never cleans this up on its own. Old projects, renamed projects, branches and different Xcode versions each leave their own folder behind, which is why it's often the single biggest developer folder on a Mac.

Check how big it is

du -sh ~/Library/Developer/Xcode/DerivedData

To see which projects take the most space:

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

Option 1: delete it from Terminal (fastest)

  1. Quit Xcode (⌘Q).
  2. Run:
    rm -rf ~/Library/Developer/Xcode/DerivedData
  3. Open your project and build. Xcode recreates the folder automatically.

Safe Nothing in DerivedData is source code or settings. The only cost is that your next build is a clean build (slower once) and Xcode re-indexes the project for a few minutes.

Option 2: delete it from Finder

  1. In Finder, press ⇧⌘G (Go to Folder) and paste ~/Library/Developer/Xcode/DerivedData.
  2. Select everything inside and move it to the Trash, then empty the Trash.

You can also find the folder from Xcode: Xcode → Settings → Locations, then click the small arrow next to the Derived Data path.

Option 3: just one project

If only one project misbehaves (stale autocomplete, "No such module" errors that won't go away), delete just its folder. Folder names look like MyApp-abcdefghijklmnop. In Xcode, Product → Clean Build Folder (⇧⌘K) clears that project's build output, but not its index.

Will it come back?

Yes — that's expected. DerivedData grows again as you build. Clearing it every month or two, or whenever you're low on space, is a normal routine for iOS and macOS developers.

Things that are not DerivedData

Other Xcode folders behave differently. Archives contain the debug symbols for apps you shipped, so don't delete them blindly; iOS DeviceSupport and old simulators are usually even bigger. See Xcode taking up too much space for the full list.

Do it in one click with MacDejunk

MacDejunk is a free Mac app that finds this junk (and the rest of what Xcode, Android, Node, Flutter and Homebrew leave behind), shows what's safe to delete, and frees the space. Everything stays on your Mac.

Download MacDejunk — free