Guide

Xcode and Docker filling your disk: what is safe to delete, what is not

Two folders account for most of the “System Data” on a developer Mac. Here is what each part is for, what happens if it goes, and the command that removes it.

Two folders account for most of the “System Data” on a developer Mac. Here is what each part is for, what happens if it goes, and the command that removes it.

Two folders account for most of the “System Data” on a developer Mac. Here is what each part is for, what happens if it goes, and the command that removes it.

Xcode, folder by folder

Everything Xcode keeps lives under ~/Library/Developer. See what is there before deleting anything:

du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* 2>/dev/null | sort -h

DerivedData: safe. ~/Library/Developer/Xcode/DerivedData holds build intermediates, indexes, and module caches, one folder per project. Xcode rebuilds all of it; the cost is a slower first build and some re-indexing. Delete it when a build behaves strangely or whenever it is large:

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Quit Xcode first, or use Product > Clean Build Folder for one project.

Archives: not safe to delete blindly. ~/Library/Developer/Xcode/Archives is every build you archived for TestFlight or the App Store, with its dSYM files. A crash report from a shipped build can only be symbolicated with that build’s dSYMs, and App Store Connect does not always hand them back. Keep every archive for a version that is still live or still in TestFlight; delete the rest by date:

ls ~/Library/Developer/Xcode/Archives

Or in Xcode’s Organizer, where each archive shows its version and you can delete one at a time.

iOS DeviceSupport: mostly safe. ~/Library/Developer/Xcode/iOS DeviceSupport (and the watchOS, tvOS, visionOS siblings) holds debug symbols for every OS version you ever plugged in, a few GB each. Xcode downloads them again when you next debug on a device with that OS, so folders for versions you no longer test cost only a re-download:

ls ~/Library/Developer/Xcode/iOS\ DeviceSupport

CoreSimulator devices: safe, with a catch. ~/Library/Developer/CoreSimulator/Devices holds a disk image per simulator, including every app and database your app wrote in it. Simulators left over from older runtimes are pure waste:

xcrun simctl delete unavailable

xcrun simctl list devices shows the rest and xcrun simctl delete <udid> removes one with its data. Do not rm -rf this folder; simctl keeps a registry that gets out of sync.

Runtimes, previews, caches. Simulator runtimes are several GB each; xcrun simctl runtime list shows them and xcrun simctl runtime delete <id> removes one you no longer target. SwiftUI previews under ~/Library/Developer/Xcode/UserData/Previews and ~/Library/Caches/com.apple.dt.Xcode are safe and rebuilt as needed.

Docker Desktop: why Docker.raw does not shrink

Docker Desktop keeps every image, container, volume, and build cache inside one Linux disk image, by default at:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

Two things about it confuse people. Finder and ls -l show its maximum size, not its usage; Docker’s docs give the example of 2.3 GB used against a 64 GB maximum, and du -h shows the real number. And it does not shrink on its own: deleting files inside a running container frees nothing on the Mac, and after you delete images Docker says it can take a few minutes to hand the space back.

So “can I delete Docker.raw” has one answer: not as a file, because that is every image, container, and volume you have. Shrink what is inside instead, starting with the report:

docker system df -v

It lists images, containers, local volumes, and build cache with a reclaimable column. Then prune by category, from least to most consequential:

docker container prune # stopped containers docker builder prune -a # all build cache docker image prune -a # images not used by any container

Each asks for confirmation. docker image prune without -a removes only dangling layers; with -a it removes every image no container references, which frees real space and means the next docker compose up downloads again. All three leave volumes alone because they hold databases; docker volume rm <name> when you are sure. docker system prune does containers, networks, dangling images, and build cache in one go; add -a --volumes for everything. Read the list before you type y.

If the file is still large after a prune, Settings > Resources > Advanced in Docker Desktop shows the image’s location, maximum size, and real usage. Lowering the maximum deletes the image and everything in it, so treat that slider as a reset, not a cleanup. OrbStack and Colima keep their data elsewhere (~/OrbStack, ~/.colima) with their own prune commands.

Doing this in Room Service

Room Service’s Clean screen lists the folders above with a risk label and a note on what happens if each goes. DerivedData, Xcode caches, and previews are Safe. Archives, device support, CoreDevice install deltas, and simulator devices are Review: never picked by Quick Clean (Safe), with a guidance popover before you check them. The archive one says “Crash reports from those releases can no longer be symbolicated, and App Store Connect cannot give you their dSYMs again.” Simulator devices go through simctl, not rm, and nothing is selected for you when a scan finishes.

Docker goes through the Docker CLI, not the filesystem. The Docker Cleanup sheet shows stopped containers, build cache, and unused images with counts and reclaimable size from docker system df, and prunes what you pick with docker container prune -f, docker builder prune -a -f, and docker image prune -a -f. Docker.raw is shown but never selectable; OrbStack, Colima, Lima, Podman, and Rancher Desktop data is shown, never offered. Volumes are not touched.

Deletes go to the Trash by default, or to Quarantine with a one-click Undo. Rows owned by a running Xcode or Docker Desktop are refused with “Xcode is running. Quit it first, then try again.” Scans and dry runs are free; a real cleanup needs Pro. In the terminal, roomservice clean --dry-run --safe and roomservice docker preview show what would go.

Related

Frequently Asked Questions

Is it safe to delete Xcode DerivedData?

Can I delete Xcode Archives?

Why is Docker.raw 60 GB?

Does `docker system prune` delete my volumes?

What is iOS DeviceSupport and can I delete it?

Why does Room Service refuse to delete something while Xcode is open?

More guides