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.
The five questions
Temporary files Xcode creates every time you build an app.
Xcode keeps them for every project you've ever built, even ones you deleted long ago.
Yes. Xcode recreates them automatically.
Your next build of each project takes a little longer.
Yes, for the projects you keep building.
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. TidyMac shows when each project was last built, so projects you haven't touched in two 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/*See your own xcode build files in seconds
Scan free, see every part of your storage explained, and clean only what’s safe. Everything goes to the Trash first.
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).