How to Remove Docker, Homebrew and Xcode From a Mac Completely

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. MacCove Space 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

ToolWhere the space goesTypical size
Docker DesktopThe virtual disk holding images, containers and volumes20–100GB+, depending on your disk limit
HomebrewInstalled packages plus a download cache1–20GB
XcodeThe app, simulator runtimes, DerivedData, archives and device support files15–80GB+

Docker Desktop

To free space but keep Docker

Run this in Terminal to remove stopped containers, unused networks, dangling images and build cache:


Add **-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

1. Open Docker Desktop, click **Troubleshoot** (the bug icon at the top right) and choose **Uninstall**. Confirm.
2. Or, from Terminal: **/Applications/Docker.app/Contents/MacOS/uninstall**
3. Move **Docker.app** to the Trash.
4. Delete these leftover folders if they're still there:
LeftoverWhat it is
~/Library/Group Containers/group.com.dockerShared Docker Desktop data
~/Library/Containers/com.docker.dockerDocker Desktop's container, including its virtual disk
~/.dockerCLI 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


This 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

1. 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.
2. 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.
3. At the end, the script lists files it didn't delete. Review them and remove the ones you're sure about.
4. 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:
WhatWhereSafe to delete?
DerivedData (build products and indexes)~/Library/Developer/Xcode/DerivedDataYes. Rebuilt on the next build
Simulator runtimesXcode → Settings → ComponentsYes, for platforms you no longer test
Unavailable simulatorsDevices for old SDKsYes: xcrun simctl delete unavailable
iOS DeviceSupport~/Library/Developer/Xcode/iOS DeviceSupportYes, for iOS versions you no longer debug on
Archives~/Library/Developer/Xcode/ArchivesOnly 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

  1. 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.

  2. Quit Xcode and move Xcode.app to the Trash.

  3. Delete ~/Library/Developer, which holds DerivedData, archives, device support files and simulator devices. Back up any archives you need first.

  4. Delete ~/Library/Caches/com.apple.dt.Xcode.

  5. 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. MacCove Space 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

  • How to Clear System Data on a Mac

  • How to Find Large Files on a Mac

Sources

← Back to all articles