Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
macOS 上的 Gateway 网关生命周期
macOS 应用默认通过 launchd 管理 Gateway 网关,不会将 Gateway 网关作为子进程生成。它会先尝试附加到已在配置端口上运行的 Gateway 网关;如果没有可访问的实例,则会通过外部openclaw CLI 启用 launchd
服务(没有嵌入式运行时)。这样你就能获得可靠的登录自动启动和崩溃后自动重启。
子进程模式(由应用直接生成 Gateway 网关)目前未在使用。
如果你需要与 UI 更紧密耦合,请在终端中手动运行 Gateway 网关。
默认行为(launchd)
- 应用会安装一个每用户 LaunchAgent,标签为
ai.openclaw.gateway(使用--profile/OPENCLAW_PROFILE时为ai.openclaw.<profile>;也支持旧版com.openclaw.*)。 - 启用本地模式时,应用会确保 LaunchAgent 已加载,并在需要时 启动 Gateway 网关。
- 日志会写入 launchd gateway 日志路径(可在 Debug Settings 中查看)。
ai.openclaw.<profile>。
未签名开发构建
scripts/restart-mac.sh --no-sign 用于没有
签名密钥时的快速本地构建。为了防止 launchd 指向未签名的 relay 二进制文件,它会:
- 写入
~/.openclaw/disable-launchagent。
scripts/restart-mac.sh 会清除此覆盖项。
如需手动重置:
仅附加模式
若要强制 macOS 应用永不安装或管理 launchd,请使用--attach-only(或 --no-launchd)启动它。这会设置 ~/.openclaw/disable-launchagent,
因此应用只会附加到已在运行的 Gateway 网关。你也可以在 Debug Settings 中切换相同行为。
远程模式
远程模式绝不会启动本地 Gateway 网关。应用会使用指向 远程主机的 SSH 隧道,并通过该隧道进行连接。为什么我们偏好 launchd
- 登录时自动启动。
- 内置重启/KeepAlive 语义。
- 可预测的日志和监管机制。