docs/platforms/mac/dev-setup.md
Build and run the OpenClaw macOS application from source.
pnpm install
./scripts/package-mac-app.sh
Outputs dist/OpenClaw.app. Without an Apple Developer ID certificate, the
script falls back to ad-hoc signing.
For dev run modes, signing flags, and Team ID troubleshooting, see
apps/macos/README.md.
Fast dev loop from repo root: scripts/restart-mac.sh (add --no-sign for
ad-hoc signing; TCC permissions do not stick with --no-sign).
The packaged app embeds the canonical scripts/install-cli.sh installer. On a
fresh profile, choose This Mac during onboarding; the app installs the
matching user-space CLI and runtime before starting the Gateway wizard.
For manual development recovery, install the matching CLI yourself:
npm install -g openclaw@<version>
pnpm add -g openclaw@<version> and bun add -g openclaw@<version> also
work. Node remains the recommended runtime for the Gateway itself.
The macOS app build expects the latest macOS SDK and the Swift 6.2 toolchain (Xcode 26.2+).
xcodebuild -version
xcrun swift --version
If versions don't match, update macOS/Xcode and re-run the build.
If the app crashes when you try to allow Speech Recognition or Microphone access, it may be a corrupted TCC cache or signature mismatch.
Reset TCC permissions for the debug bundle id:
tccutil reset All ai.openclaw.mac.debug
If that fails, temporarily change BUNDLE_ID in
scripts/package-mac-app.sh
to force a clean slate from macOS.
Check whether a zombie process holds the port:
openclaw gateway status
openclaw gateway stop
# If you're not using a LaunchAgent (dev mode / manual runs), find the listener:
lsof -nP -iTCP:18789 -sTCP:LISTEN
If a manual run holds the port, stop it (Ctrl+C), or kill the PID found above as a last resort.