Safely reduce macOS "System Data (Other Storage)" with two simple scripts.
scripts/cleanup-macos-sysdata.sh: General cleanup (cache/log/tmp + optional extras)scripts/cleanup-rn-macos.sh: Opinionated cleanup for React Native developersscripts/install-cleanup.sh: One-step installer for wrapper commands
Safe defaults: By default, only user space (
~/Library) is cleaned. System paths are opt‑in and may requiresudo.
git clone https://github.com/<user>/macos-sysdata-cleanup.git
cd macos-sysdata-cleanup
# No sudo needed
bash scripts/install-cleanup.sh
# Try it
cleanup-macos-sysdata --dry-run
cleanup-rn-macos --dry-runThe installer drops cleanup-macos-sysdata and cleanup-rn-macos into ~/.local/bin and can update your shell rc so they are available immediately.
# Only the general command
bash scripts/install-cleanup.sh --only-sysdata
# Only the RN command
bash scripts/install-cleanup.sh --only-rn
# Both (default) or interactive picker
bash scripts/install-cleanup.sh --both
bash scripts/install-cleanup.sh # asks 1/2/3 in TTYalias cleanup-macos-sysdata="bash ~/path/to/macos-sysdata-cleanup/scripts/cleanup-macos-sysdata.sh"
alias cleanup-rn-macos="bash ~/path/to/macos-sysdata-cleanup/scripts/cleanup-rn-macos.sh"
source ~/.zshrc# If you see: sudo: ./install-cleanup.sh: command not found
bash scripts/install-cleanup.sh
# Or make executable and run directly
chmod +x scripts/install-cleanup.sh
./scripts/install-cleanup.shStart safe: preview changes first with --dry-run.
# Preview only
bash scripts/cleanup-macos-sysdata.sh --dry-run
# Safe defaults (no prompts)
bash scripts/cleanup-macos-sysdata.sh --yes
# Include browsers, Xcode, simulators
bash scripts/cleanup-macos-sysdata.sh --yes --browsers --include-xcode --include-simulators
# System caches/logs + Time Machine local snapshots (sudo recommended)
sudo bash scripts/cleanup-macos-sysdata.sh --yes --system-caches --system-logs --tm-local-snapshots
# Age filter example
bash scripts/cleanup-macos-sysdata.sh --yes --days 14--dry-run,--yes|-y,--days N--user-caches/--no-user-caches,--logs/--no-logs,--tmp/--no-tmp--system-caches,--system-logs,--tm-local-snapshots--include-homebrew,--browsers,--include-xcode,--include-simulators,--include-docker,--include-ios-backups
# Preview
scripts/cleanup-rn-macos.sh --dry-run
# Non‑interactive
scripts/cleanup-rn-macos.sh --yes
# Target a project
scripts/cleanup-rn-macos.sh --yes --project ~/Projects/my-rn-app
# Aggressive: wipe all simulator disk images
scripts/cleanup-rn-macos.sh --yes --wipe-simulatorsCleans up:
- Xcode DerivedData and Simulator cache/disk/log
- Metro / Watchman temp files
- Gradle cache and Android AVD images
- CocoaPods cache/repos and project
Pods - npm/yarn/pnpm caches
- Optional Homebrew cleanup
- Use
sudowhen system paths are involved. - First build may take longer after clearing Xcode/Simulator/Gradle/AVD/Pods.
--wipe-simulatorsdeletes all simulator disk images permanently.
Why prefer aliases?
They call the script via bash, avoiding permission changes while keeping convenience.
How much space can I free? It varies. Xcode/Simulator/AVD/Docker assets grow fast; periodic cleanup often frees many GBs.
See README-tr.md for Turkish docs.
MIT — see LICENSE.