How to Clean Xcode Caches on Mac (DerivedData, Archives, Simulators)
How to Clean Xcode Caches on Mac (DerivedData, Archives, Simulators)
If you build iOS or macOS apps, Xcode is one of the fastest ways to burn through disk space. DerivedData, Archives, simulators, and SwiftPM caches can grow to dozens of gigabytes without any warning in the Storage overview.
This guide explains what each folder does, what you can delete safely, and how to automate the cleanup. For a broader storage strategy, see how to free up disk space on Mac.
Why Xcode Uses So Much Space
Xcode stores several independent categories of data:
- DerivedData — intermediate build products, indexes, and module caches. Safe to delete; Xcode will rebuild on the next compile.
- Archives — release builds for App Store Connect and ad-hoc distribution. Old archives are often forgotten.
- Simulators — full device runtime images. Removing unused runtimes recovers large amounts of space.
- SwiftPM — checkouts and build artifacts under
.buildand SwiftPM caches. - Device support — symbols for connected iOS devices; older versions can be removed if you no longer test those OS versions.
None of these are “your source code.” They are reproducible artifacts, which is why deleting them is usually low risk.
Clean DerivedData Manually
- Quit Xcode.
- Open Finder and press Shift + Command + G.
- Paste:
~/Library/Developer/Xcode/DerivedData - Delete the contents (or the whole folder). Xcode will recreate it.
Alternatively, in Xcode: Settings → Locations → Derived Data and click the arrow to open the folder in Finder.
Remove Old Archives
Archives live under:
~/Library/Developer/Xcode/Archives
Each dated folder is an Xcode archive. Delete archives for old versions you no longer need to ship or debug. Keep recent ones if you still symbolicate crash logs from those builds.
Trim Simulator Runtimes
- Open Xcode → Settings → Platforms (or Components on older Xcode).
- Remove iOS/watchOS/tvOS runtimes you no longer use.
You can also delete data under ~/Library/Developer/CoreSimulator — but prefer removing platforms via Xcode first to avoid breaking active projects.
SwiftPM and CocoaPods
- SwiftPM: Checkouts under
~/Library/Caches/org.swift.swiftpmand project.buildfolders. - CocoaPods:
Podsfolder can be regenerated withpod install.
If you are unsure, keep a backup or use version control before deleting large folders inside a project.
Automate Xcode Cleanup with NythyCleaner
NythyCleaner includes a Developer / Xcode section that scans common developer paths, summarizes how much space each category uses, and lets you clean them in one workflow. You can pair it with:
- Disk Space — treemap view to see where space goes beyond Xcode.
- System cleanup — caches and logs that add up next to Xcode.
Safety Checklist
- Close Xcode before deleting DerivedData or large simulator data.
- Do not delete your
~/Developeror project folders unless you intend to. - Keep recent App Store archives if you still need to upload or debug matching builds.
Summary
| Location | Typical contents | Safe to delete? |
|---|---|---|
| DerivedData | Build outputs, indexes | Yes (rebuilds) |
| Archives | IPA/IPA-related archives | Yes, if obsolete |
| Simulators | Runtime images | Yes, unused runtimes |
| SwiftPM caches | Dependencies, builds | Usually yes |
Cleaning Xcode caches regularly keeps SSDs fast and avoids surprise “disk full” errors during builds.