How to delete Xcode DerivedData and other developer caches on Mac

Xcode keeps build files in ~/Library/Developer/Xcode/DerivedData. It is safe to delete everything in that folder when Xcode is closed: Xcode builds it again. Old simulators, iOS DeviceSupport files and package manager caches (npm, Homebrew, Gradle, CocoaPods, pip) are also safe to remove. Keep Xcode Archives for the apps you ship.

Xcode

Quit Xcode first. Then:

  • DerivedData (build files, indexes): safe to delete. Xcode builds it again on the next build.
rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • iOS DeviceSupport (~/Library/Developer/Xcode/iOS DeviceSupport): one folder for each iOS version you connected. Delete the old versions. Xcode copies them again when you connect a device with that version.
  • Simulators: remove simulators for runtimes you no longer have, and old runtimes in Xcode › Settings › Components.
xcrun simctl delete unavailable
  • Archives (~/Library/Developer/Xcode/Archives): keep the archives of builds you shipped. They hold the debug symbols you need to read crash reports.

Package managers

Each tool has its own clean command. All of these caches download again when a build needs them.

npm cache clean --force brew cleanup --prune=all pip cache purge pod cache clean --all swift package purge-cache go clean -cache

For Gradle, stop the daemons and delete ~/.gradle/caches. For Yarn, run yarn cache clean. For pnpm, run pnpm store prune.

With SpeedyMac Pro

SpeedyMac Pro finds DerivedData, simulator caches, device support files, the Xcode documentation cache, and the npm, Yarn, pnpm, Homebrew, Gradle, CocoaPods, SwiftPM, pip, Cargo, Go and JetBrains caches in one scan. It shows each one with its size, skips the caches of tools that are running, and moves what you choose to the Trash. Archives are listed for review and are never selected for you. Pro costs $19.99 once.

Questions

Is it safe to delete DerivedData?

Yes, when Xcode is closed. DerivedData holds build products and indexes that Xcode makes again. The next build takes longer.

Can I delete iOS DeviceSupport?

Yes. Xcode copies the files again when you connect a device that runs that iOS version. Delete the folders for versions you no longer test on.

Should I delete Xcode Archives?

Only the ones you no longer need. Archives of builds you shipped hold the debug symbols you need to read crash reports from users.

Last updated 10 November 2026. More guides.

Free up space with undo

Download free for macOS

SpeedyMac 1.9.9 · macOS 14 or later · Apple silicon and Intel · Everything goes to the Trash first