Disk Housekeeper
Clear Xcode DerivedData
DerivedData is Xcode's build cache. Smart Clean can include it. Preview the path, then let it go to the Trash.
DerivedData is where Xcode keeps indexes, module caches, and intermediate build products. It is often large, and it is recreatable. The next build after a removal is slower because Xcode has to make it again.
Disk Housekeeper Smart Clean can include Xcode DerivedData along with other developer caches. The clean still previews, and the default destination is still the Trash.
Steps
Quit the build you care about
Do not remove DerivedData while you are waiting on a compile. Finish or stop the build first. Your source trees are not inside DerivedData, but the open project will rebuild.
Find DerivedData in the preview
The usual location is ~/Library/Developer/Xcode/DerivedData. Read the path in the preview. If you have more than one Xcode project, the folder holds more than one subdirectory.
Remove it to the Trash
Confirm the preview, and leave the files in the Trash. If a project misbehaves, you can put the folder back before you empty the Trash. After you are satisfied, empty the Trash to take the space back.
Expect a longer next build
That cost is the trade. Indexes and module caches come back as you work. If you need the space more than you need the warm build, this is the right clean. If you do not, skip this item in the preview.
Before you start
- Do not delete the Xcode application itself. DerivedData is the cache, not the IDE. See Xcode.
- A custom DerivedData location in Xcode's settings will not match the default path. Trust the preview's path over a remembered one.
Questions
Will my source code be deleted?
DerivedData holds build products and indexes, not your repository. Still read the preview. The Trash is the default so a mistake is recoverable until you empty it.
Does Disk Housekeeper delete APFS snapshots as part of this?
No. Snapshot deletion is not one of the cleaners described for Disk Housekeeper.