The short answer
- 01
DerivedData is safe to delete, at ~/Library/Developer/Xcode/DerivedData. Xcode rebuilds it; the next build is a full one.
- 02
Quit Xcode, then trash the folders inside it. Terminal: rm -rf ~/Library/Developer/Xcode/DerivedData/* deletes them for good.
- 03
Clean Build Folder (Product menu) clears only the current project, not all of DerivedData.
- 04
Keep Xcode Archives of shipped apps. They hold the dSYM files you need to read crash reports.
- 05
iOS DeviceSupport is safe to delete. Xcode copies the symbols again when you connect that device.
- Xcode/
-
Safe
You lose: Build products and the index. The next build is a full build.
Check sizedu -sh ~/Library/Developer/Xcode/DerivedDataClear (Xcode quit, deletes for good)rm -rf ~/Library/Developer/Xcode/DerivedData/*In Xcode: Xcode > Settings > Locations, click the arrow next to Derived Data. Product > Clean Build Folder clears only the current project.
-
Safe
You lose: Cached device symbols. Xcode copies them again when you connect that device. watchOS and tvOS have matching folders.
Path~/Library/Developer/Xcode/iOS DeviceSupportHow: Delete the subfolders for OS versions you no longer debug, not the parent folder.
-
Careful
You lose: For shipped builds, the dSYM files used to symbolicate crash reports. A rebuild cannot recreate them.
Path~/Library/Developer/Xcode/ArchivesIn Xcode: Window > Organizer > Archives, delete one at a time. Only for builds you never shipped.
- CoreSimulator/
-
Safe
You lose: Simulator caches that regenerate while the runtime is installed, so the space may come back.
Path~/Library/Developer/CoreSimulator/CachesHow: Move it to the Trash from Finder.
-
Careful
You lose: App data inside each simulator.
Remove unsupported simulatorsxcrun simctl delete unavailable - Your projects
-
Never
You lose: Everything. These are not caches and cannot be rebuilt.
What DerivedData is
To clear Xcode DerivedData, quit Xcode and delete the contents of ~/Library/Developer/Xcode/DerivedData. It holds everything Xcode generates while building: compiled products, the code index, build logs and a shared module cache. Each project gets a folder named after it plus a hash.
It is a cache, never your source files, and Xcode does not prune it. If your Mac is short on space in general, start with the full guide to freeing disk space on a Mac.
Which Xcode folders are safe to delete?
Xcode spreads data across several folders under ~/Library/Developer. They do not carry the same risk.
| Folder | Verdict | What you lose |
|---|---|---|
Xcode/DerivedData | Safe | Build products and the index. The next build is a full build. |
Xcode/iOS DeviceSupport (also watchOS and tvOS) | Safe | Cached device symbols. Xcode copies them again when you connect that device. |
CoreSimulator/Caches | Safe | Simulator caches that regenerate while the runtime is installed. |
Xcode/Archives | Careful | For shipped builds, the dSYM files used to symbolicate crash reports. Cannot be recreated. |
CoreSimulator/Devices | Careful | App data inside each simulator. See how to delete old iOS simulators. |
Your project source and .xcodeproj | Never | Everything. These are not caches. |
Clear DerivedData from Xcode and Finder
- Open Xcode > Settings > Locations. The Derived Data field shows the path.
- Click the small arrow next to the path to reveal the folder in Finder.
- Quit Xcode.
- Move the folders inside DerivedData to the Trash, then empty the Trash.
To clear only your current project, use Product > Clean Build Folder (Shift+Cmd+K). The rest stays.
Clear DerivedData from Terminal
Quit Xcode first so it does not write into the folder while you delete it.
du -sh ~/Library/Developer/Xcode/DerivedData
Shows how much space DerivedData uses. Removes nothing.
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Deletes every project's build data immediately, without using the Trash. Xcode recreates the folders on the next build.
If you changed the location in Settings > Locations, use that path instead.
Xcode Archives and dSYM files
Archives are in ~/Library/Developer/Xcode/Archives, grouped by date. Per Apple's documentation, an archive for distribution stores the binaries and dSYM files, and you should keep the archive for every build you distribute. A binary and a dSYM match only with identical build UUIDs, so a rebuild cannot replace a lost dSYM.
Deleting the archive of a build you shipped means you may no longer be able to symbolicate crash reports from that build. Delete only archives of builds that never shipped, or download the dSYMs from App Store Connect first. To review archives, use Window > Organizer > Archives and delete one at a time.
iOS DeviceSupport
When you connect a physical iPhone or iPad, Xcode copies the symbols for that OS version into ~/Library/Developer/Xcode/iOS DeviceSupport. watchOS and tvOS have matching folders. Each version is often several GB and Xcode never removes old ones.
Delete the subfolders for OS versions you no longer debug, not the parent folder. Xcode recreates them when a device on that version connects.
Other Xcode-related caches
- Module cache.
ModuleCache.noindexsits inside DerivedData and is removed with it. - Simulator caches.
~/Library/Developer/CoreSimulator/Cachesholds per-runtime caches. They regenerate, so the space may come back until the runtime is removed. - SwiftUI Previews. Preview data lives under
~/Library/Developer/Xcode/UserData/Previews. Quit Xcode before touching it. - Xcode app cache.
~/Library/Caches/com.apple.dt.Xcodeexists on most Macs. Apple does not document its contents, so treat it as a generic app cache and check its size first.
Move DerivedData instead of deleting it
In Xcode > Settings > Locations you can set Derived Data to Custom and pick another drive. An external-drive location has been reported to break framework tests on "My Mac", and a slow disk makes builds slower.
See every Xcode folder's size before you delete
Hoardless finds DerivedData (Auto tier), iOS, watchOS and tvOS DeviceSupport (Auto), Archives (Confirm) and CoreSimulator Caches (Auto) under ~/Library/Developer, shows each size, and previews the plan. Folders go to the Trash and are logged in the undo log. Simulator devices (Confirm) are cleaned with xcrun simctl delete unavailable.
See HoardlessQuestions
Is it safe to delete Xcode DerivedData?
Yes. DerivedData holds build products, intermediates, the index and logs, and Xcode regenerates all of it. You lose build time, not source code.
Where is DerivedData on a Mac?
By default at ~/Library/Developer/Xcode/DerivedData. Xcode > Settings > Locations shows the active path, which can be changed.
Does Clean Build Folder delete DerivedData?
No. It clears the build folder of the current project inside DerivedData. The other projects' folders stay.
Can I delete Xcode Archives?
Only for builds you never shipped. Archives of distributed builds contain the dSYM files that match those binaries, and a rebuild does not recreate the same dSYM.
What is iOS DeviceSupport and can I delete it?
It holds symbols copied from each physical device OS version you have debugged. It is safe to delete, and Xcode copies the symbols again when you connect that device.
Why is DerivedData so big?
Each project gets its own hash-named folder with intermediates, indexes and previews, plus a shared module cache. Xcode does not prune it for you.
What is ModuleCache.noindex?
Precompiled modules shared across builds, stored inside DerivedData. It is safe to delete and rebuilds on the next build.
Does deleting DerivedData delete my Archives?
No. Archives live in ~/Library/Developer/Xcode/Archives, outside DerivedData.