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

Published: (February 22, 2026 at 09:17 AM EST)
2 min read
Source: Dev.to

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

CommandDescription
statusCPU, RAM, swap, disk, thermal — color coded
hogsProcesses > 20 % CPU or > 5 % RAM
monitorLive dashboard (3 s refresh)
cleanInteractive cleanup for Xcode/Gradle/Docker/npm caches
optimizeSpotlight, Time Machine, DNS, animation tweaks
quickOne‑shot safe cleanup
devDeveloper environment health (Android, iOS, Node, AI tools)
kill-devserversKill orphaned webpack/vite/metro/expo servers
allFull 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.

0 views
Back to Blog

Related posts

Read more »

Stop Using .any? the Wrong Way in Rails

Introduction A single block passed to .any? can silently load thousands of records into memory—no warnings, no errors, just unnecessary objects. Most Rails dev...