Xcode Guide

How to Clean Xcode DerivedData, Simulators, and Archives on Mac

Last updated: 2026-04-06

Xcode's DerivedData folder is the single largest source of hidden disk waste for iOS and macOS developers. Located at ~/Library/Developer/Xcode/DerivedData, it stores build products, module caches, indexing data, and logs for every project you have ever opened. Apple does not provide a built-in tool to manage or clean this folder. Over time DerivedData can grow to 20–60 GB. Combined with old iOS Simulator runtimes (10–30 GB), archived builds, device support files, and Swift Package Manager caches, Xcode alone can consume over 60 GB of disk space that is entirely safe to reclaim.

What is DerivedData?

DerivedData is a folder where Xcode stores intermediate build products, compiler module caches, SourceKit indexes, and build logs. Each project you open in Xcode gets its own subfolder inside DerivedData. These files are generated during compilation and indexing — they are not source code and can always be regenerated. Deleting DerivedData forces Xcode to rebuild from scratch the next time you open a project, which typically takes 1–5 minutes depending on project size.

Where does Xcode store DerivedData?

The default location is ~/Library/Developer/Xcode/DerivedData. You can verify this in Xcode by going to Settings → Locations → Derived Data. Each subfolder is named after the project with a unique hash suffix. The folder is hidden inside the Library directory, so it is not visible in Finder by default — you need to press Cmd+Shift+G and paste the path, or use Terminal.

iOS Simulator runtimes and device support files

Every time you update Xcode or install a new iOS version, old simulator runtimes accumulate at ~/Library/Developer/CoreSimulator. Device support files for every iPhone and iPad you have ever connected are stored under ~/Library/Developer/Xcode/iOS DeviceSupport. These can add 10–30 GB. You can delete old simulator runtimes using `xcrun simctl delete unavailable` or by removing runtime folders manually, but CodeCleaner makes this visible and manageable with per-runtime size breakdowns.

Xcode Archives and Swift Package Manager cache

Archives from past App Store submissions live at ~/Library/Developer/Xcode/Archives. The Swift Package Manager stores resolved dependencies at ~/Library/Caches/org.swift.swiftpm. Both grow over time and can be safely cleaned without affecting your current projects — SPM will re-download packages as needed.

How CodeCleaner automates Xcode cleanup

CodeCleaner scans all Xcode-related cache locations in parallel, shows per-project DerivedData sizes, identifies stale simulator runtimes, and lists archives and device support files with their sizes. You select which items to remove and CodeCleaner handles deletion safely using whitelist-based rules. It is the fastest way to reclaim Xcode disk space without manually navigating hidden Library folders.

Manual steps (Terminal)

You can do this manually with these commands, or use CodeCleaner to automate the process with a visual interface and safety checks.

rm -rf ~/Library/Developer/Xcode/DerivedData
xcrun simctl delete unavailable
rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
rm -rf ~/Library/Caches/org.swift.swiftpm

Or use CodeCleaner

CodeCleaner automates all of this with a native macOS app. It auto-detects your installed tools, scans the relevant paths in parallel, shows per-item sizes, and lets you clean safely with one click. Free scan, no account required.