Xcode Guide

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

Last updated: 2026-04-13

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.

Before you delete large Xcode folders

Quit Xcode if it is open while you remove big DerivedData trees — this avoids transient indexing errors that clear on the next rebuild. Keep simulator runtimes for the iOS versions you still ship against. After clearing the Swift Package Manager cache expect re-resolution the first time you build offline-heavy projects.

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. Each block shows a short label and the matching command.

Remove DerivedData

rm -rf ~/Library/Developer/Xcode/DerivedData

Delete unavailable simulators

xcrun simctl delete unavailable

Remove Xcode Archives

rm -rf ~/Library/Developer/Xcode/Archives

Remove old DeviceSupport

rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport

Clear Swift Package Manager cache

rm -rf ~/Library/Caches/org.swift.swiftpm

Frequently asked questions

Will deleting DerivedData delete my source code?
No. DerivedData only holds generated indexes, intermediates, and build products. Your Swift, Objective-C, and project files in your repository are untouched. Xcode rebuilds DerivedData the next time you compile.
How long does an Xcode rebuild take after a full clean?
Typically one to several minutes for medium projects, longer for very large apps. You trade that wait once for tens of gigabytes of disk space.

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.

Related topics

Short landing pages focused on specific searches; each links back to the same download and safety model as the homepage.

CodeCleaner on the home page

Download, feature overview, and comparison with generic cleaners live on the main landing page.

Open homepage — download