Xcode taking up too much space: what's safe to delete
Xcode itself takes several GB, and what it leaves behind often grows much larger: build folders, simulators, simulator runtimes and debug symbols for every device you've plugged in.
The short answer: DerivedData, Device Support folders, preview simulators and simulators you no longer use are safe to remove: Xcode builds or downloads them again when it needs them. Keep your Archives unless you're sure you won't need them.
Where does Xcode keep all that data?
~/Library/Developer/Xcode/DerivedData: build output and indexes for every project you've opened. Safe: rebuilt on the next build, which is slower once.~/Library/Developer/Xcode/iOS DeviceSupport(and thewatchOS,tvOS,macOSandvisionOSones): debug symbols copied from each device and system version you connected. Safe: copied again the next time you connect that device.~/Library/Developer/CoreSimulator/Devices: your simulators, with the apps and data installed in them. Simulators whose runtime is gone are dead weight.- Simulator runtimes (a whole iOS, watchOS or visionOS for the simulator, several GB each). macOS counts them as System Data, not as Xcode.
~/Library/Developer/Xcode/UserData/Previews: simulators made for SwiftUI previews. Safe: recreated automatically.~/Library/Developer/CoreSimulator/Cachesand~/Library/Developer/XCTestDevices: simulator caches and the clones made for parallel testing. Safe.~/Library/Developer/Xcode/Archives: every build you archived for the App Store or TestFlight. Review: see below.
How do I delete DerivedData?
- Quit Xcode.
- In Finder, choose Go › Go to Folder (Shift-Command-G) and paste
~/Library/Developer/Xcode/DerivedData. - Select the folders inside and move them to the Trash. To free the space, empty the Trash.
In Terminal, this does the same but skips the Trash, so there's no undo:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
How do I remove old simulators and simulator runtimes?
Let Xcode's own tool do it, so its list of simulators stays right:
xcrun simctl delete unavailable
xcrun simctl runtime list
xcrun simctl runtime delete <runtime identifier>
The first line removes simulators whose runtime is no longer installed. The other two list the installed runtimes and remove one you don't test on any more. You can also remove a runtime in Xcode › Settings › Components (Platforms in older Xcode versions), and single simulators in Window › Devices and Simulators.
Is it safe to delete iOS DeviceSupport?
Yes. Each folder holds the symbols of one device and system version, so Xcode can show readable stack traces while you debug on it. Delete the folders for versions your devices no longer run. If you connect such a device again, Xcode copies the symbols again, which takes a few minutes.
Should I delete Xcode Archives?
Only the ones you're sure about. An archive holds the exact build you shipped and its debug symbols (dSYM). Without it you can't turn crash reports from that version into readable stack traces or export that build again. Keeping the archives of versions people still use is a good rule.
Why is the space back a week later?
DerivedData grows again with every build, and a new Xcode or iOS version brings new runtimes and device support. That's normal: these folders are caches. Clearing them now and then, or when the disk runs low, is enough.