Xcode DerivedData: what it is and whether it’s safe to delete

Temporary files Xcode creates every time you build an app.

Short answer

Yes. ~/Library/Developer/Xcode/DerivedData holds intermediate build files and indexes that Xcode recreates automatically. Deleting it loses nothing you wrote; the next build of each project just takes a little longer. Quit Xcode first so it isn’t writing to the folder.

Skip the manual steps. Tidy Mac finds this and every other hidden space hog on your Mac in under a minute.

The five questions

What is this?

Temporary files Xcode creates every time you build an app.

Why is it big?

Xcode keeps them for every project you've ever built, even ones you deleted long ago.

Is it safe to remove?

Yes. Xcode recreates them automatically.

What happens after?

Your next build of each project takes a little longer.

Will it come back?

Yes, for the projects you keep building.

Our verdict: Safe. Your Mac or your apps recreate this automatically. Removing it won’t lose anything you made.

How big it gets: 5–80 GB on developer Macs. It keeps folders for projects you deleted long ago.

Where it lives: ~/Library/Developer/Xcode/DerivedData

Clean one project or all of them

Each folder inside DerivedData is named after a project followed by a hash. Removing a single folder resets just that project. Removing them all is fine too. Sort the folder by Date Modified in Finder and projects you haven't built in months are easy to spot.

Keeping it small

Xcode never prunes DerivedData on its own. Clearing it every few months, or whenever you switch Xcode versions, keeps it from quietly growing past 50 GB.

Do it yourself

Quit Xcode, then delete the DerivedData folder in Finder (Go > Go to Folder > ~/Library/Developer/Xcode/DerivedData).

rm -rf ~/Library/Developer/Xcode/DerivedData/*
~/Library/Developer/Xcode/DerivedData. Quit Xcode first; Tidy Mac won't remove it while Xcode is open.

With Tidy Mac: Xcode build files

Tidy Mac’s Clean screen lists each project folder in DerivedData with its size, as Safe to clear and preselected. It won’t touch them while Xcode is open. Whatever Tidy Mac removes goes to the Trash first, and History lets you undo it.

See your own xcode build files in seconds

See every part of your storage explained, and clear junk to the Trash with Undo. $9.99 $29 once, 2 Macs.

Frequently asked questions

Is it safe to delete xcode build files on a Mac?

Yes. Xcode recreates them automatically.

Why are my xcode build files so big?

Xcode keeps them for every project you've ever built, even ones you deleted long ago.

What happens after I remove xcode build files?

Your next build of each project takes a little longer.

Will xcode build files come back?

Yes, for the projects you keep building.

How do I clean xcode build files manually?

Quit Xcode, then delete the DerivedData folder in Finder (Go > Go to Folder > ~/Library/Developer/Xcode/DerivedData).

Keep reading