Xcode fills a Mac mainly through DerivedData, CoreSimulator devices, simulator runtimes and iOS DeviceSupport under ~/Library/Developer. Quit Xcode, then clear DerivedData, delete unavailable simulators, remove old runtimes and old DeviceSupport folders. Leave Archives alone unless you are sure.
What is taking up space in ~/Library/Developer?
Run this to see which folders are biggest. It only reads sizes and deletes nothing:
du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* 2>/dev/null | sort -h
On a Mac that has run Xcode for a few years, the usual suspects are these.
| Folder | What it is | Call |
|---|---|---|
Xcode/DerivedData | Build products, indexes, logs | Safe to clear |
Xcode/UserData/Previews | SwiftUI preview data | Safe to clear |
Xcode/iOS DeviceSupport | Symbols copied from each iPhone or iPad you plugged in | Safe to clear (old versions) |
CoreSimulator/Devices | One folder per simulator, with its apps and data | Look first |
| Simulator runtimes | The iOS, watchOS and tvOS system images | Look first |
Xcode/Archives | Builds you archived for distribution | Keep unless you checked |
The sections below go in the order that is safest, from folders that rebuild on their own to ones that hold your work.
In what order should I clear Xcode storage?
- Quit Xcode and the Simulator app. Deleting files while Xcode is building can corrupt a build or crash it.
- Clear DerivedData and Previews (the safest wins).
- Remove old iOS DeviceSupport folders.
- Delete unavailable simulators, then reset the rest if you need more.
- Remove simulator runtimes you no longer test on.
- Last, decide about Archives.
How do I delete Xcode DerivedData?
DerivedData is where Xcode puts everything it builds for a project: compiled objects, the index it uses for autocomplete, and build logs. It is rebuilt from your source, so deleting it costs time, not data. Expect a slower first build and a re-index afterward.
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/UserData/Previews
These commands permanently delete the folders. They do not go to the Trash and cannot be undone. Both rebuild from your source code.
You can also do this from Xcode: Settings, Locations, then the arrow next to the DerivedData path to open it, and move the folders to the Trash yourself. Details on the folder are in Xcode DerivedData on Mac.
What is iOS DeviceSupport and can I delete it?
Each time you connect a device running a new iOS version, Xcode copies that version's system symbols to ~/Library/Developer/Xcode/iOS DeviceSupport, so it can debug the device. One folder per version and chip, often several gigabytes each. Old versions you no longer test on are safe to remove; Xcode copies the files again the next time you plug in such a device.
ls -lh "$HOME/Library/Developer/Xcode/iOS DeviceSupport"
rm -rf "$HOME/Library/Developer/Xcode/iOS DeviceSupport/17.2 (21C62)"
Replace the folder name in the second command with a real one from the first. The quotes matter because the folder name has spaces. This deletion is permanent. See iOS DeviceSupport for more.
How do I delete old iOS simulators?
Simulator devices live in ~/Library/Developer/CoreSimulator/Devices, one folder of apps and data per simulator. First list them, then remove the ones whose runtime is gone:
xcrun simctl list devices
xcrun simctl delete unavailable
delete unavailable removes simulators whose runtime is no longer installed. It does not touch simulators you can still boot.
If you need more space, this resets every simulator to factory state:
xcrun simctl shutdown all
xcrun simctl erase all
erase all removes the apps, app data and settings inside every simulator. The devices stay, but the contents are gone for good. If a test app keeps a local database you care about, skip this.
A simulator you are running right now should not be erased, so shut them down first. More on the folder at CoreSimulator devices.
How do I remove old simulator runtimes?
A runtime is the downloaded iOS (or watchOS, tvOS, visionOS) system a simulator runs. Each is often several gigabytes, and recent Xcode versions keep them as disk images outside your home folder, so the du command above does not count them. List and delete:
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-identifier>
Copy the identifier from the list output. You can also open Xcode, then Settings, then Components, and delete a runtime there. Apple has no single page covering these commands; reports on the Apple Developer Forums show that a runtime sometimes stays stuck in a deleting state or returns after a restart. If that happens, delete it from Xcode's Components pane and restart the Mac.
Should I delete Xcode Archives?
Archives are not caches. Each .xcarchive under ~/Library/Developer/Xcode/Archives is a build you made for the App Store or for testers, and it contains the debug symbols (dSYMs) that turn crash reports into readable lines. Deleting a shipped version's archive can make its crashes hard to read later. Open Xcode's Organizer, look at the dates, and remove only archives for versions you will never need to debug. This is why Xcode Archives is a "Look first" or "Keep" call, never an automatic one.
How does Clean House handle Xcode storage?
Clean House recognizes Xcode DerivedData, iOS DeviceSupport and simulators as developer data and shows them in the Dev Desk room with a "Why?" card: which app made the folder, when it was last used, and what happens if it goes (a rebuild, or a re-download). Each item gets one call: Safe to clear, Look first or Keep. It avoids moving things in use, such as a booted simulator. Cleaning moves items to the Trash after a re-check, and Recently Cleared puts them back until you empty the Trash.
For the same job on other tools, see Gradle and Android Studio storage and node_modules disk space.