Guide · Xcode
Free up disk space from Xcode: DerivedData, simulators and device support
Updated · Scott Havird
short answer
Quit Xcode and delete ~/Library/Developer/Xcode/DerivedData; the next build recreates it. Then run xcrun simctl delete unavailable to drop simulators whose runtime is gone, delete old folders under ~/Library/Developer/Xcode/iOS DeviceSupport, and remove simulator runtimes you no longer test on. Keep Archives unless you're sure you won't need their crash-report symbols.
What takes the space
| What | Where | Safe to delete? |
|---|---|---|
| DerivedData: build products, indexes, logs | ~/Library/Developer/Xcode/DerivedData | regenerable rebuilt by the next build, which will be slower once |
| Device support: debug symbols copied from each iPhone, Watch or TV OS version you connected | ~/Library/Developer/Xcode/iOS DeviceSupport (also watchOS, tvOS, visionOS) | regenerable copied again when that device connects |
| Simulator devices and their data | ~/Library/Developer/CoreSimulator/Devices | expensive unavailable ones yes; others lose their installed apps and data |
| Simulator runtimes (one per iOS version) | Managed by xcrun simctl runtime | expensive re-downloaded from Xcode > Settings > Components |
| Archives of builds you shipped | ~/Library/Developer/Xcode/Archives | review they hold dSYMs you need to symbolicate crash reports |
Measure them by hand
du -sh ~/Library/Developer/Xcode/DerivedData
du -sh ~/Library/Developer/Xcode/*DeviceSupport/* 2>/dev/null | sort -h
du -sh ~/Library/Developer/CoreSimulator/Devices
du -sh ~/Library/Developer/Xcode/Archives
xcrun simctl list devices unavailable # simulators whose runtime is no longer installed
xcrun simctl runtime list # installed simulator runtimes and their identifiers
Clean it up safely by hand
# DerivedData: quit Xcode first
rm -rf ~/Library/Developer/Xcode/DerivedData
# Device support for an OS version you no longer debug on
rm -rf ~/Library/Developer/Xcode/"iOS DeviceSupport"/"<old version folder>"
# Simulators whose runtime is gone
xcrun simctl delete unavailable
# A simulator runtime you no longer need (identifier from 'xcrun simctl runtime list')
xcrun simctl runtime delete <identifier>
- DerivedData is always safe. Xcode's own Product > Clean Build Folder only clears the current project; deleting the folder clears all of them, including projects you deleted long ago.
- Leave runtimes to
simctl. Runtimes are disk images the system manages, so delete them withxcrun simctl runtime deleteor from Xcode > Settings > Components rather than by hand. Runtimes bundled with Xcode itself can't be deleted this way. xcrun simctl erase allis a different thing. It resets every simulator's content and settings but keeps the devices. Only use it if you don't need any simulator's app data.- Archives need a decision. Delete them from Xcode's Organizer only for builds you no longer support, or export their dSYMs first.
How lysosome does it
lysosome caches --category xcode # read-only report
lysosome clean --caches --only 'xcode-*' # dry run: DerivedData and device support
lysosome clean --caches --only 'xcode-*' --tier regenerable_expensive
# also unavailable simulators and runtimes
lysosome reports DerivedData and each device support version as regenerable and moves them to the Trash. Unavailable simulators and deletable runtimes are regenerable_expensive and go through xcrun simctl delete unavailable and xcrun simctl runtime delete, so a plain clean leaves them alone. Runtimes bundled with Xcode and the Archives folder are labeled review and never cleaned. Xcode detection only runs on macOS.
The same scan covers the rest of a dev Mac: dormant agent worktrees, build artifacts, local AI models, Docker and package caches.