The safe question is not “Can I delete Xcode files?” It is: What created this directory, what will I lose, and how does it come back?

Start with the large category, not a cleanup command

Pause active builds and simulator work. A large directory proves size; it does not prove that the contents are stale or safe to remove.

CategoryWhat it containsSafer actionRecovery cost
Derived DataPer-project intermediates, indexes, logs, and generated productsClose Xcode, identify one project entry, and move only that entry to Trash when the project can rebuildA full rebuild and re-index; the next build may be materially slower
ArchivesRelease archives, symbols, and distribution metadataReview in Xcode Organizer and retain every archive and dSYM needed for a shipped buildThe exact archive may not be reproducible from today’s source, tools, or signing state
Simulator runtimesShared operating-system imagesUse Xcode Settings → Components for OS versions you no longer testA large download before that runtime can be used again
Simulator devicesPer-device apps, data, settings, and test stateUse Window → Devices and Simulators for devices whose state is no longer neededInstalled apps and local test data are lost; a clean device can be recreated
Device supportFiles Xcode uses with physical OS and device versionsLeave it alone until the exact Xcode and device recovery path is verifiedDebugging that device may require preparation or another download
Project outputTool-owned directories such as SwiftPM .buildPrefer the build tool’s cleanup path; otherwise move the exact rebuildable output to TrashDependencies and products rebuild or download again

Treat Derived Data as rebuildable, not free

Derived Data is often the first useful place to look because Xcode regenerates build products and indexes. Close Xcode, stop related build tools, identify the folder belonging to a project you still have, then move that one folder to Trash. If you cannot connect a folder to a project you can rebuild, leave it alone.

Protect archives for anything you shipped

Archives are not ordinary cache. They can hold the exact product and debug symbols needed to understand a customer crash. Keep the archive and dSYMs for every supported or distributed version. “The source still exists” is not the same as “the exact archive can be recreated.”

Remove simulator runtimes through Xcode

A runtime is an entire platform operating system shared by simulator devices. Use Xcode Settings → Components for platform versions outside the active compatibility matrix. The removal is reversible by download, but projects cannot run against that simulator version until it returns.

Separate simulator devices from runtimes

A simulator device carries its own installed apps, documents, settings, and test state. In Xcode, open Window → Devices and Simulators and remove only devices whose state you no longer need. Keep any device holding a reproduction, seeded database, login state, or other evidence.

Leave physical-device support out of blanket cleanup

Device-support recovery behavior changes with Xcode and the connected device. Do not apply a recursive delete rule to the category. First verify the installed Xcode, physical OS versions still under test, and the current supported recovery path.

Clean project output through its owning tool

Project output is easier to reason about when the manifest and build tool identify its owner. SwiftPM .build data can be recreated, but the next dependency resolution and build may cost time and network access. Prefer the tool’s own clean action when it exists and move manual cleanup to Trash before emptying it.

A safe order of operations

  1. Finish or cancel active builds and simulator jobs.
  2. Identify the largest category and its owning project, simulator, platform, or tool.
  3. Preserve shipped archives and simulator state used for an active reproduction.
  4. Use Xcode’s Components and Devices and Simulators controls for runtimes and devices.
  5. Move one rebuildable project output or Derived Data entry to Trash.
  6. Reopen the project and verify the expected build, simulator, and debugging workflow.
  7. Empty Trash only after that check; space in Trash may not appear as free yet.

What Roomier can do today

The current development build can scan a chosen folder or volume, draw relative storage, report inaccessible items, recognize developer-artifact families, and explain evidence on-device. Direct cleanup is narrower than recognition: eligible SwiftPM .build, unambiguous Git-ignored node_modules, verified default Next.js .next output, and metadata-proven individual Xcode Derived Data project entries can enter the immutable cleanup plan. Shared containers, archives, simulator data, device support, custom output, package source checkouts, and unproven families remain inspect-only or provider-managed.

Primary sources