A safe, interactive storage analyzer and cleaner for macOS developers.
| Feature | Details |
|---|---|
| Storage Analysis | Scans ~/Library, Application Support, Developer and shows the top 10 largest folders |
| Smart Detection | Warns when VS Code, Xcode, iOS Simulators, Android, or Docker exceed 5 GB |
| Interactive Menu | Step-by-step cleanup with a y/n confirmation before any deletion |
| Dry-run Mode | Preview exactly what would be deleted, without touching anything |
| Safety Guardrails | Only deletes known-safe directories (caches, logs, DerivedData, simulators) |
| Zero dependencies | Pure bash — no Homebrew, no Python, no npm |
# Clone or download the repo
git clone <repo-url>
cd macdoctor
# Make files executable
chmod +x macdoctor install.sh
# Install to /usr/local/bin (requires sudo)
./install.shAfter installation, run from anywhere:
macdoctormacdoctor [options]
Options:
--dry-run, -n Preview what would be deleted (no actual deletion)
--version, -v Print version and exit
--help, -h Print usage and exit
macdoctor- Scans your
~/Libraryand shows disk usage. - Warns about any developer tools using more than 5 GB.
- Presents an interactive menu:
1. Clean VS Code cache
2. Clean Xcode DerivedData & Archives
3. Remove iOS Simulators
4. Clean Android AVD
5. Run all cleanups
q. Exit
Each action asks for confirmation before deleting anything.
macdoctor --dry-runRuns the full scan and shows every path that would be deleted — nothing is actually removed. Safe to run at any time.
macdoctor only removes directories it knows are safe to delete. User projects and system files are never touched.
| Cleanup | Paths removed |
|---|---|
| VS Code cache | ~/Library/Application Support/Code/Cache |
~/Library/Application Support/Code/CachedData |
|
~/Library/Application Support/Code/CachedExtensionVSIXs |
|
~/Library/Application Support/Code/GPUCache |
|
~/Library/Application Support/Code/logs |
|
~/Library/Application Support/Code/Crashpad |
|
| Xcode | ~/Library/Developer/Xcode/DerivedData |
~/Library/Developer/Xcode/Archives (confirms separately) |
|
| iOS Simulators | Unavailable runtimes via xcrun simctl delete unavailable |
All device data via xcrun simctl erase all (optional) |
|
| Android | ~/.android/cache |
~/.android/avd/<name>/ (prompts per AVD) |
- Your source code or projects
- VS Code extensions or settings
- Xcode application itself
- System files outside
~/Library - Any directory not in the explicit whitelist
══════════════════════════════════════════════
🩺 macdoctor v1.0.0
══════════════════════════════════════════════
▸ 🔍 Scanning ~/Library...
~/Library 82G
~/Library/Application Support 45G
~/Library/Developer 30G
▸ 📊 Top 10 Largest Folders in ~/Library
★ 30G ~/Library/Developer ← biggest
2. 22G ~/Library/Application Support/Code
3. 12G ~/Library/Caches
...
▸ 🧠 Smart Detection
⚠️ VS Code is using 22G
⚠️ Xcode is using 18G
iOS Simulators 4.2G
Docker 3.1G
▸ 🛠 Cleanup Menu
1. Clean VS Code cache
2. Clean Xcode DerivedData & Archives
3. Remove iOS Simulators
4. Clean Android AVD
5. Run all cleanups
q. Exit
Enter choice: 1
Clean VS Code cache? (y/n) y
⠸ Removing VS Code/Cache (1.2G)...
✅ Removed VS Code/Cache (1.2G freed)
✅ VS Code cache cleaned.
- macOS (any recent version)
- bash 3.2+ (pre-installed on macOS)
xcrun/ Xcode command-line tools (only needed for Simulator cleanup)
sudo rm /usr/local/bin/macdoctorMIT