How to free disk space from Xcode on a Mac
Last updated 21 October 2026
If you build apps for Apple platforms, Xcode is often the largest thing on your Mac after Photos. Most of what it stores is a cache that it rebuilds on the next build, but a few folders hold things you can't get back. Here's which is which, roughly from the biggest win to the smallest.
DerivedData: safe to delete
DerivedData holds build products, indexes and logs for every project you've opened. It grows with every project and branch and is often 10 to 50 GB. Deleting it is safe: the next build is slower while Xcode rebuilds it. Quit Xcode first.
du -sh ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData/*You can also open Xcode's Settings, choose Locations, and click the arrow next to the DerivedData path to open the folder in Finder.
Simulators and simulator runtimes
Each iOS, watchOS, tvOS and visionOS simulator runtime takes several gigabytes, and old ones stay after Xcode updates. Remove simulators for runtimes that are no longer installed, then list and delete runtimes you don't test on:
xcrun simctl delete unavailable
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-identifier>You can also manage runtimes in Xcode's Settings under Components (Platforms in older versions). A deleted runtime can be downloaded again there.
Device support files
Every time you connect a device running a new OS version, Xcode copies symbols for it into ~/Library/Developer/Xcode/iOS DeviceSupport (with similar folders for watchOS and tvOS). Folders for OS versions your devices no longer run are safe to delete; Xcode copies them again the next time such a device connects.
du -sh ~/Library/Developer/Xcode/*DeviceSupportArchives: keep the ones you shipped
~/Library/Developer/Xcode/Archives holds the archives you built for distribution. Each one contains the dSYM files you need to read crash reports from that release, so they're not a cache. Keep the archives for builds that are still in users' hands, and delete old test builds from Xcode's Organizer window rather than in Finder.
Caches and package downloads
~/Library/Caches/com.apple.dt.Xcodeis Xcode's own cache and rebuilds itself.~/Library/Caches/org.swift.swiftpmand~/Library/org.swift.swiftpmhold Swift Package Manager downloads, fetched again when needed.- CocoaPods keeps a cache you can clear with
pod cache clean --all.
If you no longer develop for Apple platforms at all, deleting Xcode from Applications frees its own 10 GB or more, but remember to clear the folders above too: uninstalling Xcode doesn't remove them.
How DiskCity handles Xcode
DiskCity is in development. Xcode's folders appear as buildings in the city's Developer district, with their sizes and when you last opened them. DerivedData is labelled as rebuildable and safe to clear, and any cleanup is a plan you approve item by item. Join the waitlist to hear when it launches.
