Free space taken by Xcode on your Mac: DerivedData, old simulators and runtimes, iOS DeviceSupport, archives and CocoaPods, with what is safe to delete.
Where Xcode keeps its space
Xcode spreads its files across ~/Library/Developer. On a Mac used for iOS work for a year or two, 30 to 100 GB there is common. Check the folders first:
du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* 2>/dev/null | sort -h
The biggest are usually DerivedData, iOS DeviceSupport, simulator devices and simulator runtimes.
DerivedData
~/Library/Developer/Xcode/DerivedData holds build products, indexes and logs for every project you have opened. It is fully rebuilt by Xcode, so deleting it is safe. The cost is a slower first build and a fresh index.
# Quit Xcode first
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Inside Xcode, Product → Clean Build Folder (⇧⌘K) clears only the current project.
Simulators and runtimes
Simulators whose iOS version is no longer installed still keep their data. Remove them with:
xcrun simctl delete unavailable
Each simulator runtime (an iOS, watchOS or visionOS version) takes several GB. List them and remove old ones, or use Xcode → Settings → Components:
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-id>
Simulator caches in ~/Library/Developer/CoreSimulator/Caches are rebuilt on the next boot and are safe to clear.
iOS DeviceSupport
Every time you connect a device running a new iOS version, Xcode copies its debug symbols into ~/Library/Developer/Xcode/iOS DeviceSupport, a few GB each. Folders for iOS versions your devices no longer run can go; Xcode copies them again if that version connects.
Archives: keep the ones you shipped
~/Library/Developer/Xcode/Archives holds every build you archived. Unlike the rest, these cannot be recreated: their dSYM files are what turn crash reports from shipped builds into readable stack traces. Delete old ones from Window → Organizer only for versions no user runs anymore.
Previews, documentation and CocoaPods
~/Library/Developer/Xcode/UserData/Previews: SwiftUI preview data, rebuilt when a canvas opens.~/Library/Developer/Xcode/DocumentationCache: rebuilt when documentation opens.~/Library/Caches/CocoaPods: clear it withpod cache clean --all; the nextpod installdownloads again.- A project's
Podsfolder is recreated bypod install, so it is safe to remove in projects you are not working on.
How DevDuster handles Xcode
- DerivedData, simulator caches, preview data and the documentation cache are in the safe tier.
- Unavailable simulators, old iOS DeviceSupport (the newest version is always kept) and
Podsfolders in projects idle for 14 days are in review. - Old simulator runtimes (the newest per platform is kept) and archives older than 90 days are in caution: you pick each one.
Do it in one pass. DevDuster is a free, open-source Mac cleaner for developers. It finds all of the above, shows exact paths and sizes, and moves only what you confirm to the Trash.
Every rule DevDuster ships, with its exact paths, is on What's safe to delete.