Free up space on a developer Mac
DerivedData, simulators, Docker images, node_modules, and Homebrew caches are usually rebuildable. Remove what you can name, leave projects and volumes that hold real data, and empty the Trash only after a quick check.
What usually fills a developer Mac
Developer tools keep rebuildable caches next to real projects. The safe habit is: quit the tool, remove only folders you can name, confirm the project still opens, then empty the Trash. Space returns after Empty Trash — not when items first move there.
Xcode DerivedData
~/Library/Developer/Xcode/DerivedData holds build products and indexes. It is safe to remove when Xcode is quit. Xcode recreates what it needs on the next build.
- Quit Xcode.
- Finder → Go → Go to Folder… → paste
~/Library/Developer/Xcode/DerivedData. - Move the folder’s contents (or the whole DerivedData folder) to the Trash.
- Open your project once. Expect a longer first build.
- Empty the Trash only after that check.
You can also clear DerivedData from Xcode: Settings → Locations → click the arrow beside Derived Data, then remove folders there.
Simulators and platforms
Unused iOS, watchOS, or visionOS simulators and platform support files can be large.
- In recent Xcode versions, open Xcode → Settings → Platforms (or Components on older Xcode) and remove platform runtimes you do not need.
- To remove unavailable simulator devices from the command line:
xcrun simctl delete unavailable.
Note: Menu names change between Xcode versions. If you don’t see Platforms, search Xcode Settings for “Platforms” or “Simulators”.
Docker
Docker images, containers, and build cache grow quietly. Prefer Docker’s own prune over deleting Docker’s disk file by hand.
- CLI (after reviewing what will go):
docker system dfto see usage, thendocker system prune. Add-aonly if you intend to remove unused images too. Add--volumesonly if you mean to delete unused volumes — that can remove data, not just cache. - Docker Desktop has a Troubleshoot or Settings area with cleanup / reclaim space controls. Labels vary by Desktop version.
Note: Docker Desktop’s button names change between versions. The commands above work in every version. Don’t delete Docker.raw or Docker’s data directory unless Docker’s docs for your version say to reset.
node_modules
Each Node project can have a node_modules folder. It is safe to remove for a project you can reinstall.
- Confirm you have a lockfile (
package-lock.json,pnpm-lock.yaml, oryarn.lock) or know the install command. - Quit editors and dev servers using that project.
- Move that project’s
node_modulesto the Trash (not your whole project). - Run
npm ci,pnpm install, oryarnas appropriate.
Global npm/yarn caches are separate. Prefer the package manager’s cache-clean command when you mean the download cache, not a project.
Homebrew caches
- See what would be removed:
brew cleanup --dry-run. - Remove old versions and caches:
brew cleanup.
That does not uninstall formulae you currently need. It clears outdated kegs and download caches Homebrew kept around.
What not to delete
- Project source trees,
.gitfolders, signing certificates, and provisioning profiles you still need. ~/Library/Developer/Xcode/UserDataunless you know you are resetting Xcode UI state.- Anything under
/System, andcom.apple.*caches. - Docker volumes that hold databases or uploaded files unless you intend to wipe that data.
Sources:
- Apple, Free up storage space on Mac
- Xcode Settings → Locations (Derived Data) and Settings → Platforms / Components for runtimes
- Homebrew:
brew cleanup/brew cleanup --dry-run - Docker:
docker system dfanddocker system prune
FAQ
Is it safe to delete Xcode DerivedData?
Usually yes, after quitting Xcode. DerivedData is rebuildable build and index data. The next build will be slower while Xcode recreates it. Do not delete your project folders or .xcworkspace files.
Will removing simulators delete my app source code?
No. Simulators are runtime devices and their data. Your project lives elsewhere. You can re-download platforms from Xcode.
Is brew cleanup safe?
brew cleanup removes old Homebrew package versions and download caches. Installed formulae you still use stay. Run brew cleanup --dry-run first if you want to see what would go.