Guides · Xcode
Not enough disk space to update Xcode? Free 40 GB or more, in order
The App Store says Xcode needs more space, but the download is only a few gigabytes. Here is why, and the order to clear space in: biggest and safest first, with the exact commands.
Short answerPlan for 40 to 60 GB free before an Xcode update. The fastest safe wins are old simulator runtimes (about 8 GB each, xcrun simctl runtime list), old versions in ~/Library/Developer/Xcode/iOS DeviceSupport, and ~/Library/Developer/Xcode/DerivedData. Then remove old Xcode betas and package caches, and empty the Trash.
Why an Xcode update needs so much room
The compressed download is only the start. The installer expands it into an Xcode.app many times larger, keeps the old copy until the new one is in place, and the first launch then offers to download the matching simulator runtime, another 8 GB or so. That is why developers regularly report the App Store refusing an update with 30 GB or more free (see this Apple Developer Forums thread). Aim for 40 to 60 GB.
Check what you have now:
df -h /
The Avail column is your free space. System Settings › General › Storage shows the same, with a breakdown that files most of Xcode's leftovers under "Developer" or "System Data".
1. Old simulator runtimes: about 8 GB each
Usually the biggest win, and the one most guides miss, because runtimes live outside your home folder.
xcrun simctl runtime list -v
xcrun simctl runtime delete --notUsedSinceDays 60 --dry-run
xcrun simctl runtime delete --notUsedSinceDays 60
On the Mac this guide was written on, six iOS runtimes took 48.4 GB, and two had never been used. The full walk-through, including which to keep, is in how to delete old simulator runtimes.
2. Old device support: several GB per version
Every time you connect an iPhone, iPad or Watch on a new OS version for debugging, Xcode copies that version's symbols to your Mac and keeps them.
du -sh ~/Library/Developer/Xcode/*DeviceSupport/* | sort -h
Move old versions to the Trash and keep the newest for each platform, plus any version a test device still runs. If you connect a device on a deleted version, Xcode copies it again, which takes a few minutes. On the same Mac, three versions took 19 GB. Which to keep: is it safe to delete iOS DeviceSupport?
3. DerivedData: anywhere from a few GB to 60
Quit Xcode first. Then move the folder's contents to the Trash (macOS 15 and later):
trash ~/Library/Developer/Xcode/DerivedData/*
Nothing in it is source code; Xcode rebuilds it on the next build, which is slower than usual. Details, and how to clear only old projects: is it safe to delete DerivedData?
4. Old Xcode copies and simulators that can't run
# any Xcode betas or old versions you no longer need?
du -sh /Applications/Xcode*.app
# simulators whose runtime is gone
xcrun simctl delete unavailable
# simulators made for SwiftUI previews
xcrun simctl --set previews delete all
A spare Xcode-beta.app can be well over 10 GB. Move it to the Trash once the release it was testing is out.
5. Package caches
brew cleanup --prune=all # Homebrew downloads
swift package purge-cache # Swift Package Manager's shared cache
pod cache clean --all # CocoaPods, if you use it
npm cache clean --force # npm, if you use it
Each of these only holds downloads; packages come back on the next install or resolve. Where each cache lives, and old node_modules folders: clear package manager caches on a Mac.
6. Empty the Trash, then update
Anything you moved to the Trash still takes up space until you empty it. Check df -h / again, then run the update.
Two tips for the update itself. If the App Store keeps failing, download the .xip from Apple's developer downloads, double-click it to expand, and delete the .xip afterwards. And after the new Xcode installs its runtime, the previous version's runtime is your next candidate for step 1.
Steps 2 to 5 in one scan
DevSweep measures device support, DerivedData, unavailable simulators, Xcode's caches and the SwiftPM, CocoaPods, Carthage and Homebrew caches side by side, explains each item and moves what you tick to the Trash. If you need something back, History has Undo. No Full Disk Access needed.