Xcode can occupy tens of gigabytes under ~/Library/Developer without touching your git repos. The safe loop is: quit Xcode, measure with du, then move regenerable caches to Trash. Archives are not cache. Do not disable SIP and do not delete anything under /System, /Library, or /usr.

Quit Xcode first

Fully quit Xcode (Xcode → Quit Xcode) and the Simulator app. Caches, indexes, and simulator files stay open while those processes run. Cleaning with Xcode still running can fail, corrupt a session, or look like “nothing happened.”

Measure with du before deleting

Allocated size is what Storage cares about. du -sh reports that for each tree. Run these in Terminal, then decide what is worth reclaiming:

zsh — measure Xcode
$ du -sh ~/Library/Developer/Xcode/DerivedData
$ du -sh ~/Library/Developer/Xcode/iOS\ DeviceSupport
$ du -sh ~/Library/Developer/Xcode/Archives
$ du -sh ~/Library/Developer/CoreSimulator
$ du -sh ~/Library/Developer/Xcode/DocumentationCache
$ du -sh ~/Library/Caches/com.apple.dt.Xcode

In Finder, use Go → Go to Folder… (⇧⌘G) and paste the same paths. Get Info shows size on disk. Prefer moving items to Trash over rm -rf so you can restore a mistake.

DerivedData — regenerate

~/Library/Developer/Xcode/DerivedData holds build products, indexes, and module caches. It is fully rebuildable. After you move it to Trash, the next build and index pass recreate what that project needs. This does not delete project sources.

Xcode also exposes the path under Settings → Locations. You can change the DerivedData folder there, or delete its contents from Finder after quitting Xcode.

DeviceSupport — re-downloaded

Symbols for connected devices live under folders such as ~/Library/Developer/Xcode/iOS DeviceSupport (and the watchOS / visionOS siblings when those platforms are installed). Xcode re-downloads symbols when you plug the device in again. Safe to remove if you do not need offline symbolication for that OS version right now.

Archives are not cache — keep dSYMs

~/Library/Developer/Xcode/Archives stores .xcarchive bundles from Product → Archive. Each archive includes the built app and dSYMs. Without those dSYMs, App Store and TestFlight crash logs stay unreadable.

Review archives in Window → Organizer. Keep any archive whose dSYMs you still need. Only remove an old archive if you already copied its dSYMs somewhere durable. Do not treat this folder like DerivedData.

CoreSimulator — caches vs devices vs runtimes

~/Library/Developer/CoreSimulator mixes caches, device data, and runtimes. Caches under CoreSimulator/Caches regenerate. Unavailable device records are safe to drop. Installed simulator runtimes and device data you still use should stay until you choose otherwise.

Preferred UI: Xcode → Settings → Platforms to remove unused runtimes, and Window → Devices and Simulators to delete simulators you no longer boot. In Terminal, after quitting Simulator:

zsh — simctl
# broken device records only
$ xcrun simctl delete unavailable
# list runtimes before removing any you still need
$ xcrun simctl list runtimes

DocumentationCache and com.apple.dt.Xcode

~/Library/Developer/Xcode/DocumentationCache is the downloaded DocC / documentation index. Xcode fetches it again when you open Developer Documentation.

~/Library/Caches/com.apple.dt.Xcode is a normal app cache. Safe to move to Trash after quitting Xcode; it regenerates on the next launch.

Regenerate vs keep

  • Regenerate: DerivedData, DeviceSupport, DocumentationCache, CoreSimulator caches, ~/Library/Caches/com.apple.dt.Xcode.
  • Keep unless you chose to uninstall that runtime: simulator runtimes and device data you still boot.
  • Keep: Archives and the dSYMs inside them. Organizer is the review UI.
  • Never: SIP off, deletes under /System, /Library, /usr, or project source trees.

After Trash, empty Trash only when you are sure. Space returns when Trash is emptied, not when files first move there. Then reopen Xcode and build once so indexes come back.

Optional review UI

Finder, Terminal, Platforms, and Organizer are enough. If you want a later review list, MacOSCleaner Smart Cleanup can show Xcode and Simulator categories with risk badges so you confirm before anything is removed. The app is optional — this page stands on its own. Related: Docker disk space and System Data reclaim order.

Frequently asked questions

Is it safe to delete Xcode DerivedData?
Yes, after quitting Xcode. DerivedData is rebuildable. The next build is slower while indexes and products regenerate. It does not delete your source repositories.
Should I delete Xcode Archives to free space?
Treat Archives as keep-by-default, not cache. Each .xcarchive holds the app and dSYMs used to symbolicate crash reports. Remove an archive only if you already have those dSYMs elsewhere.
Do I need to disable SIP to clean Xcode?
No. Xcode developer data lives under your home folder. Do not disable SIP and do not delete anything under /System, /Library, or /usr.

Automate Xcode & developer cleanup with MacOSCleaner

Free gigabytes instantly without memorizing terminal paths. MacOSCleaner safely scans DerivedData, archives, simulator runtimes, iOS device support, and package managers. 100% native Swift 6, zero telemetry; direct removeItem for confirmed caches, Trash (trashItem) for review-only, uninstaller, disk analyzer, and duplicates.