Wipecraft
English
Buy · $19

Xcode and Docker disk space on Mac: what you can delete

Xcode and Docker use disk space on a Mac in four places: Xcode build data, simulators, the caches of package managers, and the one disk image file that Docker keeps. Build data and package caches come back after you delete them. Simulators, simulator runtimes and Docker images do not come back by themselves, so that is where space stays free.

macOS counts all of this as System Data. If that name is new to you, read what System Data is.

The sizes come from the author's own Mac, a MacBook Pro with an M2 Pro chip, macOS 27.2, Xcode 27.2 and Docker Engine 29.9.2. Wipecraft scanned it on 2026-11-08. The folder sizes were read by hand on 2026-11-15. Nothing was deleted for this guide. The author makes Wipecraft. Every step on this page works without it.

How much disk space do Xcode and Docker use on a Mac?

Xcode and Docker used the space in this table on one developer Mac, measured on 2026-11-15. Simulator devices were the largest item at 53.0 GB. Xcode build data was 11.0 GB, and the Docker disk image used 8.6 GB. The third column shows whether each item comes back after you delete it.

ItemSize on 2026-11-15Does it come back?
Simulator devices53.0 GBNo
Simulator runtimes11.1 GBOnly if you download them again
Xcode build data11.0 GBYes, with the next build
Docker disk image, space in use8.6 GBNo
Swift package cache3.2 GBYes
npm cache2.9 GBYes
Gradle caches2.0 GBYes
Xcode archives77 MBNo
The Developer tools screen
The Developer tools screen in Wipecraft after the scan

The largest item was not a cache. It was 19 simulator devices. On the scan of 2026-11-08, the Simulators row was 98.8 GB, and it was in the bucket Your call.

Can you delete the Xcode DerivedData folder?

You can delete the Xcode DerivedData folder, ~/Library/Developer/Xcode/DerivedData, and lose no work. The folder holds the build products, the intermediate files and the index of each project. Xcode creates them again, so the next build of each project takes longer and the space comes back. Quit Xcode before you delete.

On this Mac the folder was 11.0 GB for 8 projects. To remove it:

  1. Quit Xcode.
  2. Move the contents of the folder to the Trash.

Apple says that the folder can be re-created at any time from your source files (help.apple.com/xcode/mac/current/en.lproj/deva52afe8a4.html). This guide can also state what happened on this Mac: the folder was cleared before the scan of 2026-11-08, and the scan found 16 kB. One week later it was 11.0 GB again.

Is it safe to delete Xcode archives?

Delete only the Xcode archives of builds that you never released. Apple says that you must keep the archive of each build that you distribute, because you need it to read crash reports. Archives are in ~/Library/Developer/Xcode/Archives, and Xcode lists them in the Organizer window. A deleted archive does not come back.

An archive is what Xcode creates when you choose Product, then Archive. It holds the app and its dSYM files. Apple's rule on keeping archives is at developer.apple.com/documentation/xcode/building-your-app-to-include-debugging-information. On this Mac the folder was 77 MB.

How do you delete old Xcode simulators and runtimes?

To delete old Xcode simulators, remove two things: simulator devices and simulator runtimes. A device is one simulated iPhone, iPad or Watch with its apps and data, and xcrun simctl delete removes it. A runtime is the system image that devices start from, and Xcode removes it in Settings, in Components. Neither comes back by itself.

Simulator devices

Devices are in ~/Library/Developer/CoreSimulator/Devices. On this Mac, 19 devices used 53.0 GB. Three commands help. The first lists the devices. The second removes the devices that the current Xcode cannot run. The third keeps a device but erases its apps and data.

xcrun simctl list devices
xcrun simctl delete unavailable
xcrun simctl erase <device>

On this Mac the second command would have removed nothing, because no device was unavailable. To remove one device that you do not use, give its name or identifier to xcrun simctl delete. A deleted device does not come back. You can create a new one in Xcode at any time, but the apps and data in it are gone.

Simulator runtimes

Xcode lists runtimes in Settings, in Components, and shows how much storage you get back when you remove one. Select the info button next to a runtime and choose Delete. Apple documents this at developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components. The same is possible in Terminal:

xcrun simctl runtime list
xcrun simctl runtime delete <identifier>
xcodebuild -downloadPlatform iOS

The first command showed two runtimes on this Mac, 11.1 GB together. The last command downloads the iOS runtime again. Keep the runtime that your projects build for.

Device support files

Xcode can also keep support files for each iPhone or iPad that you connect. Apple does not document that folder, and this Mac did not have one, so this guide gives no path and no size for it.

Can you delete the npm, Gradle and Swift package caches?

You lose nothing when you remove the cache of a package manager such as Swift Package Manager, npm, Gradle, pnpm, pip, Homebrew or CocoaPods. Each tool keeps a copy of what it downloaded and downloads the packages again when a project needs them, so the space comes back. Use the command of the tool and not Finder.

ToolCache on this MacSize on 2026-11-15Its own command
Swift Package Manager~/Library/Caches/org.swift.swiftpm3.2 GBswift package purge-cache
npm~/.npm2.9 GBnpm cache verify
Gradle~/.gradle/caches2.0 GBCleans itself
pnpm~/Library/pnpm499 MBpnpm store prune
pip~/Library/Caches/pip157 MBpip cache purge
Homebrew~/Library/Caches/Homebrew45 MBbrew cleanup

Some details from the documentation of each tool:

In Wipecraft these caches are in the bucket Comes back. On the scan they were 3.2 GB.

Why does Docker use so much disk space on a Mac?

Docker Desktop on a Mac keeps all images, containers, volumes and build cache in one disk image file named Docker.raw. Some tools show the largest size that the file may reach, not the space that it uses. Do not move or delete the file in Finder. Ask Docker what is inside with docker system df.

Where is Docker.raw and how large is it?

Docker.raw is in ~/Library/Containers/com.docker.docker/Data/vms/0/data. Finder and some other tools show the largest size that the file may reach, not the space that it uses. Docker's FAQ gives a command that shows both numbers. The full path of the file:

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

On this Mac, Finder showed 460.0 GB and the file used 8.6 GB. The command from Docker (docs.docker.com/desktop/troubleshoot-and-support/faqs/macfaqs/):

cd ~/Library/Containers/com.docker.docker/Data/vms/0/data
ls -klsh Docker.raw

Ask Docker what is inside:

docker system df
TypeSize on 2026-11-15
Images2.8 GB
Build cache4.6 GB
Volumes185 MB
Reclaimable in total6.7 GB

What does docker system prune remove?

docker system prune removes stopped containers, networks that are not in use, dangling images and build cache that is not in use. It asks you to confirm first, and it does not remove volumes. With -a it also removes every image that no container uses. These four commands remove data, in order from the least risk to the most:

docker builder prune
docker system prune
docker system prune -a
docker volume prune
CommandWhat it removesDoes it come back?
docker builder pruneBuild cacheYes. The next build takes longer
docker system pruneStopped containers, networks that are not in use, dangling images and build cache that is not in use. No volumesOnly if you download or build again
docker system prune -aThe same, and every image that no container usesOnly if you download or build those images again
docker volume pruneAnonymous volumes that no container usesNo

A volume can hold a database. That data does not come back.

These commands ask you to confirm before they delete (docs.docker.com/reference/cli/docker/system/prune/). After that there is no undo. None of them was run for this guide.

Which Docker Desktop controls delete everything?

Two controls in Docker Desktop delete more than you expect. If you make the disk limit smaller in Settings, in Resources, Docker deletes the disk image file, and all containers and images are lost. The menu item Clean up data in the Troubleshoot window destroys all containers and images on the Mac and keeps your settings.

After a prune, Docker says that the space can take a few minutes to return to macOS. Docker also says that deleting files inside a running container does not free the space by itself (docs.docker.com/desktop/troubleshoot-and-support/faqs/macfaqs/). While Docker is running, Wipecraft shows the disk image under Your Mac needs this, because the file is in use.

What comes back after you delete it, and what does not?

Xcode build data, package caches and Docker build cache come back after you delete them. Simulator runtimes and Docker images from a registry come back only as a download. Simulator devices with their data, archives, Docker volumes and images that you built do not come back.

GroupItemsWipecraft bucket
Comes backXcode build data, package caches, Docker build cacheComes back
Comes back only as a downloadSimulator runtimes, Docker images from a registryYour call
Does not come backSimulator devices with their data, archives, Docker volumes, images that you builtYour call

You can read the full bucket rules.

What should you delete first to free space?

Start with the simulator devices that you do not use, because on this Mac they were the largest item. Then remove a simulator runtime that no project needs, and then the Docker build cache. Xcode build data and package caches come back after you delete them, so that space does not stay free.

  1. Remove the simulator devices that you do not use. On this Mac they were the largest item.
  2. Remove a simulator runtime that no project needs.
  3. Run docker system df, and then docker builder prune.
  4. Clear the build data of Xcode if you need space now. It comes back.
  5. Leave the package caches, unless one of them is very large.
  6. Keep the archives of builds that you released.

Agents that write code leave other data on the same disk. Read what Claude Code and other agents keep. For caches, snapshots and backups outside the developer tools, read how to clear System Data safely.

Wipecraft scans your disk for free and shows these items with a size on every row and the same labels. It locks a simulator that is running. Items in Your call go to Quarantine first, where you can undo them for 30 days. Read how undo works. Wipecraft is the author's paid product.

See what Wipecraft finds on your Mac