How to Remove Docker, Homebrew and Xcode From a Mac Completely
Developer tools are some of the biggest space users on a Mac, and some of the hardest to remove cleanly. Dragging Docker or Xcode to the Trash removes the app, but leaves behind virtual disks, simulators, caches and build products that can add up to more than the app itself. Homebrew isn't an app at all, so there's nothing to drag. Here's how to remove each one properly, or just slim it down if you still need it.
Quick answer: Docker Desktop: open it and choose Troubleshoot → Uninstall, then delete the app and the folders ~/.docker and ~/Library/Group Containers/group.com.docker. Homebrew: run Homebrew's official uninstall script from the Homebrew/install repository on GitHub, then remove the brew shellenv line from your ~/.zprofile. Xcode: delete old simulator runtimes in Xcode → Settings → Components first, then delete Xcode.app and the ~/Library/Developer folder. If you only want space back, docker system prune, brew cleanup and deleting Xcode's DerivedData often recover tens of gigabytes without uninstalling anything. Space App shows Xcode data, simulators, Docker disks and package caches as separate categories with sizes, so you can see what's worth removing first.
How much space each one typically uses
| Tool | Where the space goes | Typical size |
|---|---|---|
| Docker Desktop | The virtual disk holding images, containers and volumes | 20–100GB+, depending on your disk limit |
| Homebrew | Installed packages plus a download cache | 1–20GB |
| Xcode | The app, simulator runtimes, DerivedData, archives and device support files | 15–80GB+ |
Docker Desktop
To free space but keep Docker
Run this in Terminal to remove stopped containers, unused networks, dangling images and build cache:
docker system pruneAdd -a to also remove all images not used by a container, and --volumes to remove unused volumes (careful: volumes can hold database data). You can also lower the virtual disk limit in Docker Desktop → Settings → Resources.
To uninstall Docker Desktop completely
Open Docker Desktop, click Troubleshoot (the bug icon at the top right) and choose Uninstall. Confirm.
Or, from Terminal: /Applications/Docker.app/Contents/MacOS/uninstall
Move Docker.app to the Trash.
Delete these leftover folders if they're still there:
| Leftover | What it is |
|---|---|
| ~/Library/Group Containers/group.com.docker | Shared Docker Desktop data |
| ~/Library/Containers/com.docker.docker | Docker Desktop's container, including its virtual disk |
| ~/.docker | CLI configuration and contexts |
Docker notes that you may see an "operation not permitted" error for a .com.apple.containermanagerd.metadata.plist file during removal, which can be ignored. Giving Terminal Full Disk Access (System Settings → Privacy & Security) lets you remove the remaining folders.
Homebrew
To free space but keep Homebrew
brew cleanup --prune=allThis removes old versions of packages and everything in Homebrew's download cache (~/Library/Caches/Homebrew). Add -n first for a dry run that shows what would be deleted. Homebrew also runs a cleanup automatically every 30 days. To see what you've installed and remove packages you no longer need, use brew list and brew uninstall packagename, then brew autoremove to clear dependencies nothing else needs.
To uninstall Homebrew completely
If you installed apps with Homebrew (casks) and want them gone too, remove them first. brew uninstall --zap appname also deletes the files the app's cask lists in your Library.
Run Homebrew's official uninstall script, published in the Homebrew/install repository on GitHub. It removes Homebrew and everything it installed from /opt/homebrew (Apple silicon) or /usr/local (Intel). Run it with --dry-run first to see what it will remove, and --path /usr/local if you have an older Intel-era installation.
At the end, the script lists files it didn't delete. Review them and remove the ones you're sure about.
Open ~/.zprofile in a text editor and remove the line that runs brew shellenv, so your shell stops looking for Homebrew.
Xcode
To free space but keep Xcode
Xcode's biggest space users usually aren't the app itself:
| What | Where | Safe to delete? |
|---|---|---|
| DerivedData (build products and indexes) | ~/Library/Developer/Xcode/DerivedData | Yes. Rebuilt on the next build |
| Simulator runtimes | Xcode → Settings → Components | Yes, for platforms you no longer test |
| Unavailable simulators | Devices for old SDKs | Yes: xcrun simctl delete unavailable |
| iOS DeviceSupport | ~/Library/Developer/Xcode/iOS DeviceSupport | Yes, for iOS versions you no longer debug on |
| Archives | ~/Library/Developer/Xcode/Archives | Only if you don't need old builds or their debug symbols |
You can also remove simulator runtimes from Terminal. xcrun simctl runtime list shows them, and xcrun simctl runtime delete removes one, with options such as --notUsedSinceDays and --dry-run.
To uninstall Xcode completely
Remove simulator runtimes first (Xcode → Settings → Components). They're stored outside the app, in /Library/Developer/CoreSimulator, and aren't removed when you delete Xcode.
Quit Xcode and move Xcode.app to the Trash.
Delete ~/Library/Developer, which holds DerivedData, archives, device support files and simulator devices. Back up any archives you need first.
Delete ~/Library/Caches/com.apple.dt.Xcode.
If you also want to remove the Command Line Tools (used by git, Homebrew and many developer tools), delete /Library/Developer/CommandLineTools with an admin password. Reinstall them later with xcode-select --install.
Be careful with the last step if you still use Homebrew or git: both depend on the Command Line Tools.
Finding developer leftovers you've forgotten about
If you tried iOS development a few years ago, or installed Docker for one project, the leftovers may be the largest thing on your Mac and you'd never know from Finder. Space App groups developer data, including Xcode data, simulators, Docker disks, package-manager caches and AI tool data, into its own categories with sizes, so you can see at a glance what's worth removing. For everything else, see how to clear System Data on a Mac.
FAQs
Does dragging Docker to the Trash uninstall it?
It removes the app, but leaves Docker's data, including its virtual disk, in your Library. Use Docker's own uninstall option first.
Is it safe to delete DerivedData?
Yes. Xcode rebuilds it the next time you build a project. The first build afterwards will be slower.
Will uninstalling Homebrew remove apps I installed with it?
The uninstall script removes Homebrew and its packages. Apps installed as casks may remain in Applications; uninstall them with brew uninstall --zap before removing Homebrew, or delete them like any other app afterwards.
Can I delete the Command Line Tools?
Yes, but git, Homebrew and many developer tools rely on them. Reinstall with xcode-select --install if something stops working.
Related guides
How to Uninstall Apps on a Mac Completely (Including the Files They Leave Behind)
How to Find Large Files on a Mac (5 Ways, From Finder to Terminal)