Yes. DerivedData holds what Xcode builds from your source code: compiled products, intermediate files, indexes and logs. Nothing in it is your work. Delete it and Xcode rebuilds what it needs on the next build, which will take longer once. It’s often the largest thing on a developer’s disk: 10 to 50 GB is common.
Where it is
~/Library/Developer/Xcode/DerivedDataEach project has its own folder in there, named after the project with a random suffix. You can remove one project’s folder, or all of them.
How to delete it
- Quit Xcode, so it isn’t writing to the folder while you remove it.
- In Finder, choose Go › Go to Folder, paste the path above, and drag the folders you want to remove to the Trash.
- Empty the Trash to get the space back.
Or in Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData/*Unlike the Trash, rm can’t be undone. That’s fine for DerivedData, which rebuilds; be careful pointing it anywhere else.
What else in Xcode’s folders is safe to clear
Device support files: safe
~/Library/Developer/Xcode/iOS DeviceSupportOne folder per iOS version of every device you’ve ever connected, often several gigabytes each. Xcode copies the files again the next time that device connects. Remove the ones for iOS versions you no longer run.
Unavailable simulators: safe
Simulators for runtimes you’ve since removed stay on disk. This command deletes only the ones Xcode can no longer run:
xcrun simctl delete unavailableArchives: keep, unless you’re sure
~/Library/Developer/Xcode/ArchivesThese are the builds you submitted to the App Store, with the debug symbols you need to read crash reports from those versions. Don’t delete an archive for a version people still use.
Other developer caches that rebuild themselves
~/.npm/_cacache: npm’s download cache. Or runnpm cache clean --force.~/Library/Caches/Homebrew: downloaded bottles. Or runbrew cleanup.~/Library/Caches/CocoaPods: pod downloads, fetched again when needed.node_modulesin projects you no longer work on: reinstalled bynpm installif you return.
Why it matters beyond disk space
macOS swaps memory to the startup disk. On a nearly full disk it has nowhere to put it, and a Mac that was slightly slow starts to stall. Freeing developer caches is one of the quickest ways to give swap room again. More on what makes a Mac slow.