Caretaker Download

Guide

How to delete Xcode DerivedData and old simulators on a Mac

Xcode keeps build files in DerivedData, a simulator for every device and OS you've used, and runtimes for each OS version. Together they can take over a hundred gigabytes.

Delete DerivedData

  1. Quit Xcode.
  2. Open Xcode > Settings > Locations and click the arrow next to the Derived Data path. By default it's ~/Library/Developer/Xcode/DerivedData.
  3. Delete the folders inside, or only those of projects you no longer build.

For one project, Product > Clean Build Folder (⇧⌘K) clears its build files.

Delete old simulators and runtimes

  • xcrun simctl delete unavailable deletes the simulators the current Xcode no longer supports.
  • To remove a simulator runtime, open Xcode > Settings > Components, click the info button next to it, then click Delete. Xcode shows how much space each one frees.
  • In Terminal, xcrun simctl runtime list lists runtimes. xcrun simctl runtime delete --notUsedSinceDays 90 --dry-run shows the ones not used in 90 days. Run it without --dry-run to delete them.

Deleting a simulator also deletes the apps and data installed in it. It doesn't go to the Trash.

Archives and device support

  • Archives are in ~/Library/Developer/Xcode/Archives, and in Window > Organizer. Keep the archive of every build you've shipped. Apple says you need it to read crash reports from users.
  • Device support files are in ~/Library/Developer/Xcode/iOS DeviceSupport, one folder per OS version of a device you've connected. Folders for OS versions you no longer test on can go.

Is it safe?

DerivedData is safe to delete. Xcode builds it again, so the next build and indexing take longer. Simulators and runtimes can be downloaded again. Archives of shipped builds can't be made again.

The faster way: Caretaker

Caretaker's Developer view shows DerivedData, Xcode simulators and simulator runtimes, including simulators whose runtime is gone, next to npm, pip, Cargo and Gradle caches. The view is free, and Clean All is in Pro. Simulators are deleted with Xcode's own tools, so they don't go to the Trash.

Caretaker's Clean page: safe to clear, system junk and creative app caches, in dots.
Download free

Questions

Is it safe to delete DerivedData?

Yes. It only holds build files and indexes, and Xcode makes them again on the next build.

Why is Xcode taking so much space?

Simulator runtimes, simulators, DerivedData and device support files build up with every Xcode and OS version.