返回顶部
c

clawdbot-macos-build构建Clawdbot macOS应用

Build the Clawdbot macOS menu bar app from source. Use when you need to install the Clawdbot.app companion (for menu bar status, permissions, and Mac hardware access like camera/screen recording). Handles dependency installation, UI build, Swift compilation, code signing, and app packaging automatically.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
2,103
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

clawdbot-macos-build

Clawdbot macOS 应用构建

macOS 配套应用提供菜单栏状态、原生通知以及访问 Mac 硬件(摄像头、屏幕录制、系统命令)的功能。本技能将从头构建该应用。

前置条件

  • - macOS(10.14 及以上版本)
  • Xcode 15+(含命令行工具)
  • Node.js >= 22
  • pnpm 包管理器
  • 30+ GB 可用磁盘空间(Swift 构建产物)
  • 互联网连接(大型依赖包)

快速构建

bash

克隆仓库


cd /tmp && rm -rf clawdbot-build && git clone https://github.com/clawdbot/clawdbot.git clawdbot-build

安装并构建

cd /tmp/clawdbot-build pnpm install pnpm ui:build

接受 Xcode 许可(一次性操作)

sudo xcodebuild -license accept

使用临时签名构建 macOS 应用

ALLOWADHOCSIGNING=1 bash scripts/package-mac-app.sh

安装到 /Applications 目录

cp -r dist/Clawdbot.app /Applications/Clawdbot.app

启动应用

open /Applications/Clawdbot.app

构建步骤详解

1. 克隆仓库

从 GitHub 克隆最新的 Clawdbot 源代码。macOS 应用源码位于 apps/macos/ 目录下。

2. 安装依赖(pnpm install)

安装整个工作区的 Node.js 依赖(约需 1 分钟)。某些扩展中缺失二进制文件的警告可以忽略。

3. 构建 UI(pnpm ui:build)

编译控制界面(Vite → TypeScript/React)。输出文件位于 dist/control-ui/ 目录。约需 30 秒。

4. 接受 Xcode 许可

每次 Xcode 更新后需要执行一次。如果在 Swift 构建过程中遇到许可未同意错误,请运行: bash sudo xcodebuild -license accept

5. 打包 macOS 应用(scripts/package-mac-app.sh)

运行完整的 Swift 构建流程:
  • - 获取 Swift 包依赖(SwiftUI 库等)
  • 为当前架构编译 macOS 应用(M1+ 为 arm64,Intel 为 x86_64)
  • 打包资源(模型目录、本地化文件等)
  • 对应用进行代码签名

签名选项:

  • - 临时签名(最快):ALLOWADHOCSIGNING=1 — 适合本地测试,应用无法公证以用于分发
  • 开发者 ID 签名(生产环境):如果您有签名证书,请设置 SIGN_IDENTITY=Developer ID Application: <名称>

此步骤根据 Mac 性能不同,需要 10-20 分钟。

6. 安装到 /Applications 目录

将构建好的应用复制到系统应用程序文件夹,使其像其他 macOS 应用一样运行。

7. 启动应用

打开应用。首次运行时,您会看到权限提示(通知、辅助功能、屏幕录制等)——请批准这些权限以获得完整功能。

故障排除

无效的工具版本

Swift 构建需要 6.2+ 版本。请更新 Xcode: bash softwareupdate -i -a

许可未同意

bash sudo xcodebuild -license accept

未找到签名身份

本地构建请使用临时签名: bash ALLOWADHOCSIGNING=1 bash scripts/package-mac-app.sh

Swift 编译卡住或非常慢

  • - 确保 Xcode 已完全更新:xcode-select --install 或通过 App Store 更新
  • 检查磁盘空间:df -h(需要约 30GB 可用空间)
  • 关闭其他应用以释放内存

构建后应用无法启动

检查应用是否正确签名: bash codesign -v /Applications/Clawdbot.app

如果签名失败,请使用 ALLOWADHOCSIGNING=1 重新构建。

应用功能

  • - 菜单栏状态 — 查看网关健康状态并接收通知
  • 权限管理 — 管理通知、辅助功能、屏幕录制、麦克风等 TCC 提示
  • 本地/远程模式:
- 本地模式: 网关在 Mac 上运行;应用管理 launchd 服务 - 远程模式: 应用通过 SSH/Tailscale 连接到另一台机器(VPS、家庭服务器)上的网关;即使 Mac 处于休眠状态也能保持可访问
  • - Mac 硬件访问: 摄像头、屏幕录制、Canvas、语音唤醒词
  • 深度链接: 通过 clawdbot:// URL 方案触发代理请求

请参阅官方文档:https://docs.clawd.bot/platforms/macos

构建用于分发

对于生产环境分发,您需要:

  • - Apple 开发者 ID 证书(付费)
  • 公证凭证
  • 请参阅:https://docs.clawd.bot/platforms/mac/release

个人使用的话,临时签名就足够了。

后续步骤

应用启动后:

  1. 1. 完成权限检查清单(TCC 提示)
  2. 选择本地远程模式
  3. 如果选择本地模式:确保网关正在运行(clawdbot gateway status)
  4. 打开 Clawdbot.app 菜单栏图标进行配置

然后,您可以在终端中管理网关:
bash
clawdbot gateway status
clawdbot gateway restart

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 clawdbot-macos-build-1776386171 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 clawdbot-macos-build-1776386171 技能

通过命令行安装

skillhub install clawdbot-macos-build-1776386171

下载

⬇ 下载 clawdbot-macos-build v1.0.0(免费)

文件大小: 3.04 KB | 发布时间: 2026-4-17 16:27

v1.0.0 最新 2026-4-17 16:27
Initial release of the skill to build the Clawdbot macOS companion app from source.

- Automates the full build process: dependency install, UI build, Swift compilation, code signing, and packaging.
- Supports both ad-hoc and Developer ID signing for local or production builds.
- Includes detailed build instructions, troubleshooting steps, and prerequisite requirements.
- Enables macOS app features: menu bar status, hardware access, notifications, and deep linking.
- Provides guidance for installing, launching, and configuring the app after build.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部