Xcode and iOS Simulators: where the gigabytes go and what is safe to clear
Xcode itself is only the start. Every Simulator runtime is an operating system, every simulated iPhone has its own data, and every project builds another index and set of intermediates. Treating all of it as one cache is how archives and test data get lost.
A worked developer-Mac example
This illustrative 83.7 GB footprint shows how the five areas can add up. It is not a reading from your Mac; quit Xcode and Simulator, then use the commands below to record your own sizes:
| Area | Worked example | Share | Safe action |
|---|---|---|---|
| Simulator runtimes | 38.6 GB | 46% | Remove unused OS versions in Xcode Settings > Components |
| Simulator device data | 19.4 GB | 23% | Delete individual devices, erase content, or delete unavailable devices |
| DerivedData | 14.2 GB | 17% | Safe to delete; projects rebuild and re-index |
| Archives | 8.1 GB | 10% | Review in Organizer; keep releases needed for symbolication or export |
| iOS DeviceSupport | 3.4 GB | 4% | Remove old device-OS support only when no longer debugging it |
| Total | 83.7 GB | 100% |
Measure your own Mac first
du -sh ~/Library/Developer/Xcode/DerivedData
du -sh ~/Library/Developer/Xcode/Archives
du -sh ~/Library/Developer/Xcode/iOS\ DeviceSupport
du -sh ~/Library/Developer/CoreSimulator
xcrun simctl list runtimes
xcrun simctl list devicesRuntime packages may be managed outside your home folder on newer releases, so use Xcode > Settings > Components for their recoverable size. Do not assume ~/Library/Developer/CoreSimulator includes every installed runtime.
1. Remove runtimes with Xcode
Open Xcode > Settings > Components. Xcode shows installed platforms and storage recoverable from each. Remove only OS versions your projects and test matrix no longer require. A runtime is shared by many simulated devices, so deleting ten device records does not necessarily remove the multi-gigabyte OS package.
In the worked example, two unused runtimes account for 20.3 GB. Use Xcode's recoverable-storage figure for the real amount.
2. Remove dead or disposable devices
xcrun simctl list devices unavailable
xcrun simctl delete unavailableThe first command previews the list. The second deletes only devices whose runtime is no longer installed. For a device you still use, choose Device > Erase All Content and Settings in Simulator. To remove one device, use Window > Devices and Simulators, choose Simulators, Control-click it and choose Delete.
3. Clear DerivedData when rebuilding is acceptable
DerivedData contains indexes, intermediates and build products. It is replaceable, but the next build and code index will be slower. Quit Xcode, inspect ~/Library/Developer/Xcode/DerivedData, and delete selected old project folders in Finder. Product > Clean Build Folder handles the open project.
The worked example assumes 14.2 GB before cleanup and 0.2 GB rebuilt for one active project, a 14.0 GB net recovery. Measure again after your own project re-indexes.
4. Treat Archives as releases, not cache
Open Window > Organizer > Archives. An archive can contain the exact build and debug symbols needed to investigate a crash or export a past release. Keep anything that is the only local copy. Delete old development and test archives only after checking your release and symbol-retention policy.
5. DeviceSupport is smaller, but still deliberate
~/Library/Developer/Xcode/iOS DeviceSupport holds support files for physical iOS versions you connected. Xcode can recreate or download them when that device returns, but it takes time. Remove only versions you no longer debug. This is not an attached device backup; backups live elsewhere.
Worked cleanup arithmetic
| Action | Example recovery | Cost next time |
|---|---|---|
| Two unused runtimes | 20.3 GB | Download again if that OS returns to the test matrix |
| Unavailable simulator devices | 6.8 GB | None; their runtimes were already gone |
| DerivedData | 14.0 GB net | One slower build and re-index |
| Reviewed old test archives | 4.6 GB | Those exact test builds are gone |
| Total | 45.7 GB |
That arithmetic reduces 83.7 GB to 38.0 GB. Your total will differ; the order matters more: runtimes first, device data second, replaceable build data third, archives last.
For the other build tools that accumulate beside Xcode, see developer caches that never go away. For storage macOS can reclaim itself, see how purgeable space works.
Where Zofle fits. Zofle shows DerivedData, archives and simulator folders beside the rest of your disk, with size and age. Review release archives in Xcode; use Xcode Components and Simulator controls for runtimes and devices.
Sources and method
- Apple Developer Documentation, Downloading and installing additional Xcode components: Components shows recoverable storage and is the supported runtime-removal UI.
- Apple Developer Documentation, Adding additional simulators: add and remove runtimes and devices.
- Commands are from
simctlandxcodebuildhelp shipped with Xcode. The decimal-GB tables are worked examples; Xcode version and test history determine the actual totals.
Zofle Pro news
People signing up now will get Zofle Pro, with more features, for free when we launch it.