Documentation Index
Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
macOS 开发者设置
从源码构建并运行 OpenClaw macOS 应用程序。前提条件
在构建应用前,请确保已安装以下内容:- Xcode 26.2+:Swift 开发所需。
- Node.js 24 和 pnpm:推荐用于 Gateway 网关、CLI 和打包脚本。为保持兼容性,仍支持 Node 22 LTS,目前为
22.16+。
1. 安装依赖项
安装整个项目的依赖项:2. 构建并打包应用
要构建 macOS 应用并将其打包到dist/OpenClaw.app,运行:
-)。
关于开发运行模式、签名标志和 Team ID 故障排除,请参阅 macOS 应用 README:
https://github.com/openclaw/openclaw/blob/main/apps/macos/README.md
注意:ad-hoc 签名的应用可能会触发安全提示。如果应用立即崩溃并显示 “Abort trap 6”,请参阅故障排除部分。
3. 安装 CLI
macOS 应用需要全局安装openclaw CLI 来管理后台任务。
安装方式(推荐):
- 打开 OpenClaw 应用。
- 前往 General 设置标签页。
- 点击 “安装 CLI”。
pnpm add -g openclaw@<version> 和 bun add -g openclaw@<version> 也可以使用。
对于 Gateway 网关运行时,Node 仍是推荐路径。
故障排除
构建失败:工具链或 SDK 不匹配
macOS 应用构建需要最新的 macOS SDK 和 Swift 6.2 工具链。 系统依赖项(必需):- Software Update 中可用的最新 macOS 版本(Xcode 26.2 SDK 必需)
- Xcode 26.2(Swift 6.2 工具链)
授予权限时应用崩溃
如果你尝试允许 Speech Recognition 或 Microphone 访问权限时应用崩溃,可能是 TCC 缓存损坏或签名不匹配导致的。 修复:-
重置 TCC 权限:
-
如果仍然失败,请临时更改
scripts/package-mac-app.sh中的BUNDLE_ID,以强制 macOS 从“干净状态”开始。