How to clean Xcode DerivedData, Archives and simulators
Last updated
Xcode is one of the hungriest apps on a Mac. Build products, indexes, symbol files for every iPhone you've plugged in, and simulators for several iOS versions add up to 30–100 GB in ~/Library/Developer. Most of it is safe to delete, as long as you know which part is which.
Check how big each part is
Quit Xcode and the Simulator, then run:
du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* 2>/dev/null | sort -h
Typical results, from usually‑biggest to usually‑smallest:
- DerivedData: build output and indexes for every project you've opened.
- CoreSimulator/Devices: one folder per simulated device, including installed apps and their data.
- iOS DeviceSupport (and watchOS/tvOS): symbol files copied from each physical device and OS version you've connected.
- Archives: builds you made with Product › Archive.
- CoreSimulator/Caches: dyld and other simulator caches.
Simulator runtimes themselves (each iOS version is several gigabytes) are stored by the system, not in your home folder; see below.
1. DerivedData: delete freely
Path: ~/Library/Developer/Xcode/DerivedData
Everything here is regenerated on the next build. Deleting it also fixes many "phantom" build errors and broken autocompletion. Either delete one project's folder, or clear the lot:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
In Xcode you can also open Settings › Locations and click the arrow next to the Derived Data path to open it in Finder. Expect the next build and indexing pass to be slow.
2. Device support files: delete old versions
Path: ~/Library/Developer/Xcode/iOS DeviceSupport
Each folder is named after an OS version and build, for example 17.5.1 (21F90), and can be 2–5 GB. Folders for iOS versions none of your devices run any more are dead weight. If you delete the folder for a device you still use, Xcode copies the symbols again the next time you connect it, which takes a few minutes.
3. Simulators: remove devices and runtimes you don't use
Never delete simulator folders by hand while the Simulator or Xcode is running. Use simctl, which ships with Xcode:
# simulators whose runtime is no longer installed
xcrun simctl delete unavailable
# list everything, then delete one by its UDID
xcrun simctl list devices
xcrun simctl delete <UDID>
# reset all simulators to a clean state (keeps the devices, wipes their apps and data)
xcrun simctl erase all
Runtimes (one per iOS, watchOS, tvOS or visionOS version) are the bigger items. Remove the ones you don't need in Xcode › Settings › Platforms (called Components in newer Xcode versions): select a runtime and click the minus button. From Terminal on Xcode 15 and later:
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-identifier>
The simulator caches in ~/Library/Developer/CoreSimulator/Caches are rebuilt automatically and can be cleared when the Simulator is closed.
4. Archives: keep the ones you ship
Path: ~/Library/Developer/Xcode/Archives, organised by date.
This is the one folder to think about before deleting. An archive contains your app and its dSYM files, which turn raw crash addresses back into function names. If you delete the archive for a version people still run and your dSYMs aren't uploaded anywhere else (App Store Connect, a crash reporting service), crash reports from that version become much harder to read.
The safe way is the Organizer: Window › Organizer › Archives, right‑click an archive, choose Show in Finder, and copy it to external storage before deleting. Old test builds and archives of apps you no longer maintain can go.
5. Other developer caches
~/Library/Caches/com.apple.dt.Xcode: Xcode's own cache, rebuilt automatically.~/Library/Developer/Xcode/UserData/Previews: SwiftUI preview simulators; safe to delete when Xcode is closed.- Swift Package Manager:
~/Library/Caches/org.swift.swiftpm. Packages download again when needed. - CocoaPods:
pod cache clean --all. - Old Xcode versions in
/Applications: each is 10 GB or more. Keep only the versions you build with.
Before you delete. Quit Xcode and the Simulator first. Don't remove ~/Library/Developer itself or touch /Library/Developer/CommandLineTools unless you mean to reinstall the command line tools (xcode-select --install).
Doing it with Glint
Glint's Smart Clean has a developer group with separate rules for Xcode DerivedData, device support files (iOS, watchOS and tvOS), simulator caches and Xcode archives, plus npm, pnpm and bun, Gradle and Cargo caches, each with its size. DerivedData and caches are deleted outright because Xcode rebuilds them. Archives aren't selected by default, and if you do select them they go to Quarantine first, so you can restore an archive if you need its dSYMs after all. Glint doesn't delete simulator devices or runtimes; use simctl or Xcode's Platforms settings for those.
FAQ
Is it safe to delete the whole DerivedData folder?
Yes. DerivedData only holds build products, indexes and logs that Xcode recreates. Quit Xcode first; the next build and indexing pass will take longer.
Should I delete Xcode Archives?
Only archives you no longer need. Each archive contains the dSYM files needed to symbolicate crash reports for that build, so keep the archives of every version still in use, unless your dSYMs are stored elsewhere.
Why is ~/Library/Developer so big even after cleaning DerivedData?
Simulator devices and runtimes are usually the rest. Check ~/Library/Developer/CoreSimulator and the runtimes listed by xcrun simctl runtime list.
Glint is a free disk cleaner for macOS 14 Sonoma and later, on Apple Silicon and Intel. No limits, no account, and everything stays on your Mac.