← Mac folders

What is DerivedData on Mac, and is it safe to delete?

By Irshad PC ·

Location
~/Library/Developer/Xcode/DerivedData
Safe to delete?
Yes, it rebuilds itself Xcode rebuilds it on the next build. Quit Xcode first.
SpaceUp Mac's Clean tab on September 26, 2026, before I cleaned: Xcode DerivedData, ticked, under Developer Caches, at 5.71 GB

Checked on: MacBook Air M2, macOS 26.3.1, Xcode 26.1.1, October 1, 2026. Measured size: 3.16 GB, refilled by a few builds since I cleared 5.71 GB on September 26 (the screenshot).

~/Library/Developer/Xcode/DerivedData is where Xcode puts what it generates while building your apps: compiled files, build logs, the built apps themselves and the index behind code completion and search. It’s safe to delete. Quit Xcode first, and the next build recreates what it needs. Your source code isn’t in here, so nothing you wrote is lost. The price is one slower build and some re-indexing.

What is DerivedData?

Every time you build a project, Xcode writes its intermediate files somewhere outside your project folder. By default that place is ~/Library/Developer/Xcode/DerivedData, with one subfolder per project, named after the project plus a long random-looking string. On my Mac each project folder holds a Build folder (compiled files and the built app) and a Logs folder. Next to the project folders sit shared caches such as ModuleCache.noindex, which Xcode also rebuilds.

Command-line builds use the same place unless told otherwise. The xcodebuild manual describes a -derivedDataPath option that “overrides the folder that should be used for derived data” (run man xcodebuild in Terminal). If a script or your team moved it, look where they pointed it.

It sits inside ~/Library/Developer, next to iOS DeviceSupport, CoreSimulator and your Archives. That page covers the whole folder. This one is only about DerivedData.

Is it safe to delete?

Yes. Apple itself tells developers to do it. In the Xcode 26 release notes, the workaround for two macro build failures (both since marked fixed) has you quit Xcode, “Clean out the DerivedData for the project”, then restart Xcode and build.

What you give up when you delete it:

What you don’t lose: your source code, your Xcode settings, your signing setup or your archives. Those all live somewhere else. Archives, the builds you made with Product > Archive, are in ~/Library/Developer/Xcode/Archives, not DerivedData. Keep those.

Why it gets so big

Xcode doesn’t clean it up for you. Every project you’ve opened keeps its folder, including tutorials and projects you deleted long ago. Each folder holds builds for every destination you ran on, a simulator and a real device, Debug and Release.

On my MacBook Air, SpaceUp Mac’s Clean tab showed 5.71 GB here on September 26, 2026, before I cleared it. Five days and a few builds later it was back to 3.16 GB. Clearing it buys space, not a permanent fix: it grows back as you work.

How to clear it yourself

  1. Quit Xcode. Deleting build files while Xcode has the project open can confuse a build that’s running.
  2. Open the folder. In Finder, choose Go > Go to Folder (Apple’s steps), enter ~/Library/Developer/Xcode/DerivedData, and press Return.
  3. Pick what goes. Delete everything inside, or only the folders for projects you don’t work on anymore. Each folder name starts with the project’s name.
  4. Move them to the Trash, then empty it. Or, in Terminal, rm -rf ~/Library/Developer/Xcode/DerivedData removes the whole folder at once, and Xcode creates it again on the next build. It skips the Trash, so there’s no undo.
  5. Open Xcode and build. Expect the first build of each project to take longer.

The same Library folder has other rebuildable piles: see iOS DeviceSupport, CoreSimulator and the developer junk guide for npm, Gradle and the rest.

What SpaceUp Mac does with it

SpaceUp Mac lists “Xcode DerivedData” under Developer Caches in the Clean tab, and in Dev Mode, which appears when SpaceUp Mac detects developer or AI tools. It’s marked Safe and starts ticked, with the note “Build intermediates and indexes. Xcode rebuilds these the next time you build.” Nothing is removed until you confirm on the review screen. Then SpaceUp clears what’s inside the folder directly rather than moving it to the Trash, because Xcode rebuilds it, and leaves the empty DerivedData folder in place. It clears the whole folder, not project by project.

Dev Mode also finds DerivedData folders that live inside your projects, for projects set to keep their build files next to the code. Each shows up as its own row, “DerivedData · project name”, so you can keep the ones you’re working on. That search skips your Library folder and hidden folders.

Both work the same in the direct download and the Mac App Store version, which asks you to grant access to your home folder first (how cleaning works).

Common questions

Will deleting DerivedData delete my project?

No. Your project and its source files stay in whatever folder you saved them in. DerivedData only holds what Xcode generated from them.

Why does Xcode feel slow after I delete it?

It’s rebuilding the index for code completion and search, and the first build compiles everything from scratch. Once that finishes, it’s back to normal.

How often should I clear DerivedData?

When you need the space, or when a build fails in a way a normal rebuild doesn’t fix. There’s no need to clear it on a schedule.

Is DerivedData the same as Xcode’s cache?

No. Xcode also keeps a cache at ~/Library/Caches/com.apple.dt.Xcode, outside the Developer folder. The developer junk guide covers it.

How this page was made: Drafted with AI help from Apple's documentation, vendor docs and SpaceUp's source code. Sizes measured on my MacBook Air M2 (macOS 26.3.1) on October 1, 2026. Screenshot by me.