macOS 上的 Gateway(外部 launchd)
OpenClaw.app 不再捆绑 Node/Bun 或 Gateway 运行时。macOS 应用期望使用外部 openclaw CLI 安装,不会将 Gateway 作为子进程启动,而是管理一个用户级 launchd 服务来保持 Gateway 运行(或者如果已有本地 Gateway 运行,则连接到它)。
安装 CLI(本地模式必需)
你需要在 Mac 上安装 Node 22+,然后全局安装 openclaw:
bash
npm install -g openclaw@<版本>macOS 应用的 Install CLI 按钮通过 npm/pnpm 执行相同的安装流程(不推荐使用 bun 作为 Gateway 运行时)。
Launchd(Gateway 作为 LaunchAgent)
- Label:
ai.openclaw.gateway(或ai.openclaw.<用户名>;旧版com.openclaw.*可能仍然存在) - Plist 位置(用户级):
~/Library/LaunchAgents/ai.openclaw.gateway.plist(或~/Library/LaunchAgents/ai.openclaw.<用户名>.plist) - 管理方式:
- macOS 应用在本地模式下负责 LaunchAgent 的安装/更新。
- CLI 也可以安装:
openclaw gateway install。
- 行为:
- "OpenClaw Active" 启用/禁用 LaunchAgent。
- 退出应用不会停止 gateway(launchd 保持其运行)。
- 如果配置端口上已有 Gateway 运行,应用会连接到它而不是启动新实例。
- 日志:
- launchd stdout/err:
/tmp/openclaw/openclaw-gateway.log
- launchd stdout/err:
版本兼容性
macOS 应用会检查 gateway 版本与自身版本的兼容性。如果不兼容,请更新全局 CLI 以匹配应用版本。
冒烟测试
bash
openclaw --version
OPENCLAW_SKIP_CHANNELS=1 \
OPENCLAW_SKIP_CANVAS_HOST=1 \
openclaw gateway --port 18999 --bind loopback然后:
bash
openclaw gateway call health --url ws://127.0.0.1:18999 --timeout 3000