Help · Mac storage
How to clear Xcode's cache.
If you build apps, Xcode is often the biggest thing on your Mac after your own files: build data, simulators for every iOS version you've tried, debug symbols for every device you've plugged in, and archives of every release. Some of it rebuilds by itself; some you should keep.
Quit Xcode and the Simulator first. Everything below lives in ~/Library/Developer. In Finder choose Go › Go to Folder… (⇧⌘G) and paste the paths.
Safe to delete: it rebuilds
- DerivedData (
~/Library/Developer/Xcode/DerivedData): build products and indexes. Delete the folders inside; Xcode rebuilds what it needs on the next build, which is slower that one time. Xcode shows this folder in Xcode › Settings › Locations. - Device support (
~/Library/Developer/Xcode/iOS DeviceSupport, andwatchOS DeviceSupport): debug symbols for each iOS version of devices you've connected. Delete folders for old versions; Xcode copies them again the next time you connect a device running that version. - Simulator caches (
~/Library/Developer/CoreSimulator/Caches): rebuilt by the Simulator. - SwiftUI previews (
~/Library/Developer/Xcode/UserData/Previews): rebuilt when you preview.
Review first
- Simulators: remove runtimes you don't need in Xcode › Settings › Platforms (Components in recent Xcode). Remove individual simulated devices in Window › Devices and Simulators. Or remove all simulators for runtimes that are no longer installed with:
This deletes permanently; apps and data inside those simulators go too.xcrun simctl delete unavailable - Archives (Window › Organizer › Archives): each release build with its debug symbols. Keep archives of versions still on the App Store or in testers' hands, because you need their symbols to read crash reports. Delete the rest from the Organizer.
Other developer tools
Package managers keep their own caches too. Use each tool's own clean-up command: brew cleanup, npm cache clean --force, pip cache purge, swift package purge-cache. These delete permanently and the caches rebuild as you install packages. For Docker, see reclaiming Docker's disk space.
See every developer cache, rated.
Pangalin Space Manager lists Xcode's DerivedData, device support, simulator caches, previews and SwiftPM cache as safe to clean, and simulators, archives and docsets as worth a review, each with a note on what it is. Its Janitors run other tools' own clean-up commands (Homebrew, iOS Simulators, Docker, npm, pip and more), after a confirmation that says plainly they delete permanently. Janitors need a licence, because the space they free can't be measured in advance.
Free to scan · first 5 GB freed free, then $25 a year · 14-day full refund · Notarised by Apple