DEV Community

Ammroid
Ammroid

Posted on

MacOptimize: A free bash CLI to keep your Mac fast during heavy dev workloads

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-4GB 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

Commands:
    status          CPU, RAM, swap, disk, thermal — color coded
    hogs            processes >20% CPU or >5% RAM
    monitor         live dashboard (3s refresh)
    clean           interactive cleanup for Xcode/Gradle/Docker/npm caches
    optimize        Spotlight, Time Machine, DNS, animation tweaks
    quick           one-shot safe cleanup
    dev             developer env health (Android, iOS, Node, AI tools)
    kill-devservers kill orphaned webpack/vite/metro/expo servers
    all             full report

Enter fullscreen mode Exit fullscreen mode

Real Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
System Health Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

▸ CPU & Memory
✓ CPU: 31.2% average per core
✓ Memory free: 50%
✗ Swap used: 3469M (HIGH - SSD wear warning)

▸ Disk
✓ Disk usage: 49% (16Gi free)

▸ Thermal & Power
✓ No thermal throttling detected

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 brew install. It just works on any Mac with macOS 12+.

GitHub

MIT licensed. PRs and feedback welcome.

Top comments (0)