MacOptimize: A free bash CLI to keep your Mac fast during heavy dev workloads
Source: Dev.to
The Problem
Running Xcode, Android emulator, local AI models, and a dozen browser tabs simultaneously on Apple Silicon is brutal on RAM. My M1 Pro was constantly hitting 3–4 GB swap, thermal throttling mid‑build, and I had no quick way to diagnose what was happening.
The Solution
I built macoptimize — a single Bash script, zero dependencies, that gives you instant visibility and control over your Mac’s performance.
Install
curl -fsSL https://raw.githubusercontent.com/Ammroid/macoptimize/main/install.sh | bash
Commands
| Command | Description |
|---|---|
status | CPU, RAM, swap, disk, thermal — color coded |
hogs | Processes > 20 % CPU or > 5 % RAM |
monitor | Live dashboard (3 s refresh) |
clean | Interactive cleanup for Xcode/Gradle/Docker/npm caches |
optimize | Spotlight, Time Machine, DNS, animation tweaks |
quick | One‑shot safe cleanup |
dev | Developer environment health (Android, iOS, Node, AI tools) |
kill-devservers | Kill orphaned webpack/vite/metro/expo servers |
all | Full report |
Real Output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ CPU & Memory
▸ Disk
▸ Thermal & Power
What It Cleans Up
macoptimize clean targets (asks before deleting anything):
- Xcode DerivedData: 2–20 GB
- Gradle caches: 1–5 GB
- Android AVDs: 5–30 GB
- Docker images: 5–50 GB
- npm/yarn/pnpm/bun caches: 1–5 GB
Why Bash?
No Python environment to manage, no Node version conflicts, no Homebrew install. It just works on any Mac with macOS 12+.
GitHub
macoptimize on GitHub – MIT licensed. PRs and feedback welcome.