When developing web, mobile, or AI agent applications on a base MacBook (256GB / 512GB), you eventually run into the dreaded "Your disk is almost full" alert. Xcode DerivedData, Android AVD emulators, Docker images, and package caches can easily eat up tens of gigabytes within days.

This guide covers how to turn an external SSD into a high-performance development drive, symbolic link relocation techniques for key developer tools, and one-liner CLI disk cleanup tips.


1. What Eats Up Storage on a Developer's Mac?

Here are the primary culprit directories behind bloated 'System Data' or 'Other' storage on macOS:

  • Xcode DerivedData & CoreSimulator: Build artifacts & simulator files (usually ~/Library/Developer/) - takes 20-50GB
  • Android Studio & SDK: AVD emulator images & Gradle cache (~/.android/, ~/.gradle/) - takes 15-40GB
  • Docker Desktop: Container layers & image volumes (~/Library/Containers/com.docker.docker/) - takes 20-60GB+
  • Package Manager Caches: npm, yarn, cargo, pip, and Homebrew caches - 10-30GB
⚠️ Limitation of Simple File Deletion:
Simply deleting these folders only offers temporary relief as they regenerate during the next build. The ultimate fix is relocating path targets to an external SSD or maintaining automated cleanup scripts.

2. External SSD Format & APFS Configuration

Before using an external SSD for development work, choose the right filesystem format.

exFAT vs APFS Comparison

  • exFAT: Cross-platform between Windows and Mac, but lacks proper Unix permission & symbolic link support, causing build errors in Flutter/Xcode.
  • APFS (Apple File System): Optimized for Mac symbolic links, snapshots, and high-performance I/O. APFS format is mandatory for dev drive relocation.
πŸ’‘ Recommended Setup:
Open [Disk Utility] β†’ Select External SSD β†’ Format as APFS (or APFS Case-sensitive if needed).

3. Tool-by-Tool External Drive Relocation Guide

Assuming your mounted external drive path is /Volumes/ExternalDrive, use symbolic links (ln -s) to relocate directories seamlessy:

β‘  Xcode DerivedData & iOS Simulator (CoreSimulator) Relocation

Relocate iOS/iPadOS simulator device data (CoreSimulator) and Xcode build artifacts (DerivedData) to your external SSD:

# 0. Quit Xcode & Simulator completely
killall Simulator 2>/dev/null

# 1. Xcode DerivedData Symbolic Link Relocation
mkdir -p /Volumes/ExternalDrive/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData
ln -s /Volumes/ExternalDrive/Developer/Xcode/DerivedData ~/Library/Developer/Xcode/DerivedData

# 2. iOS CoreSimulator (Apple Virtual Device Data) Relocation
mkdir -p /Volumes/ExternalDrive/Developer/CoreSimulator
cp -r ~/Library/Developer/CoreSimulator/* /Volumes/ExternalDrive/Developer/CoreSimulator/ 2>/dev/null
rm -rf ~/Library/Developer/CoreSimulator
ln -s /Volumes/ExternalDrive/Developer/CoreSimulator ~/Library/Developer/CoreSimulator

β‘‘ Android AVD Relocation

# 1. Move AVD to External SSD
mkdir -p /Volumes/ExternalDrive/Android/avd
cp -r ~/.android/avd/* /Volumes/ExternalDrive/Android/avd/
rm -rf ~/.android/avd

# 2. Connect Symbolic Link
ln -s /Volumes/ExternalDrive/Android/avd ~/.android/avd

β‘’ Docker Desktop Storage Relocation

In Docker Desktop settings: Settings β†’ Resources β†’ Advanced β†’ Virtual disk limit / Data location. Set path to /Volumes/ExternalDrive/Docker and click Apply & restart.

β‘£ Cargo (Rust) & Package Caches

# Cargo root directory symbolic link
mkdir -p /Volumes/ExternalDrive/Cargo
ln -s /Volumes/ExternalDrive/Cargo ~/.cargo

4. One-Liner CLI Commands for Quick Storage Cleanup

Even without an external SSD, run these one-liners periodically to reclaim tens of gigabytes:

πŸ”₯ One-Liner Cleanup Commands:
# 1. Xcode DerivedData & Simulator cache purge
rm -rf ~/Library/Developer/Xcode/DerivedData/*
xcrun simctl erase all

# 2. CocoaPods & Gradle cache cleanup
pod cache clean --all
rm -rf ~/.gradle/caches/

# 3. Docker unused images & container prune
docker system prune -a --volumes -f

# 4. Homebrew outdated package cleanup
brew cleanup -s

5. Summary & Key Takeaways

  • Keep External SSD Connected: Running Xcode or Android Studio without mounting the external SSD while symbolic links exist may cause path errors. Connect your SSD prior to launching IDEs.
  • Periodic Maintenance: Running these commands once a month frees up at least 30GB+ of system storage easily.

Hope this guide helps Mac developers keep their system fast and space-efficient!