想让 AI 助手在 iMessage 里帮你处理消息? BlueBubbles + OpenClaw 是目前最稳定、功能最完整的方案。
为什么选 BlueBubbles?
旧方案(imsg CLI,已弃用):
❌ 不稳定,依赖 macOS AppleScript
❌ 功能有限(只能发送文字)
❌ 每次 macOS 更新都可能失效
新方案(BlueBubbles,推荐):
✅ 稳定的 REST API
✅ 支持消息编辑和撤回(macOS 26 Tahoe 前)
✅ 支持 Tapbacks(❤️👍😂!?)
✅ 支持群组管理
✅ 支持媒体消息(图片/视频/文件)
✅ 持续维护的开源项目
第一步:安装 BlueBubbles macOS 服务器
BlueBubbles 需要一台始终开机的 Mac,并登录 Apple ID:
1. 下载 BlueBubbles Server:
https://bluebubbles.app/downloads/
2. 安装并启动 BlueBubbles Server
3. 首次运行配置:
- 选择服务器模式:Dynamic DNS / ngrok / Cloudflare Tunnel
- 设置密码(记住这个密码)
- 等待连接成功(底部状态变为绿色)
4. 记录服务器地址(类似 http://localhost:1234 或 https://xxx.ngrok.io)
推荐使用 Cloudflare Tunnel 获得稳定的公网地址:
BlueBubbles Server → Settings → Server URL 配置
选择 Cloudflare Tunnel → 自动生成 HTTPS 地址
第二步:配置 OpenClaw
json
{
"channels": {
"bluebubbles": {
"enabled": true,
"baseUrl": "http://localhost:1234",
"password": "your-bluebubbles-password"
}
}
}如果使用远程地址(ngrok/Cloudflare):
json
{
"bluebubbles": {
"baseUrl": "https://xxx.trycloudflare.com",
"password": "your-password"
}
}访问控制
DM 私信权限
json
{
"bluebubbles": {
"dmPolicy": "allowlist",
"allowedPhoneNumbers": ["+8613800138000", "+1234567890"]
}
}或使用配对模式(首次消息需确认):
json
{ "dmPolicy": "pairing" }群组访问控制
json
{
"bluebubbles": {
"groups": {
"default": {
"requireMention": true,
"mentionTrigger": "@ai"
}
}
}
}在 iMessage 群组中,需要输入 @ai 才触发 AI 回复。
触发方式
@ 提及触发(推荐用于群组)
群组消息:@ai 帮我总结一下今天的讨论
AI 只在被 @ 时回复,不打扰正常群聊
命令前缀触发
json
{
"commandPrefix": "!",
"commands": true
}!help → AI 列出可用命令
!ask 这段代码是什么意思? → AI 回答
打字状态与已读回执
json
{
"bluebubbles": {
"typingIndicator": true,
"readReceipts": true
}
}开启后:
- AI 处理消息时,对方看到「正在输入...」
- AI 回复后,消息显示已读状态
媒体消息处理
BlueBubbles 支持接收和发送多媒体:
接收:图片/视频/文件 → AI 分析内容
"帮我看看这张截图,这个错误什么意思?"
→ AI 分析截图中的错误信息
发送:AI 可以回复文字(媒体发送受 macOS 限制)
macOS 26 Tahoe 的已知限制
⚠️ macOS 26 Tahoe(2025 年发布)已知问题:
- 消息编辑功能目前在 macOS 26 上无法正常工作
- 这是 BlueBubbles Server 的已知 bug,正在修复中
- 其他功能(发消息/接消息/Tapbacks)不受影响
关注 BlueBubbles 更新:
https://github.com/BlueBubblesApp/bluebubbles-server/releases
VM/无头 macOS 的特殊配置
如果 Mac 以虚拟机或无头方式运行(无显示器), 需要确保 Messages.app 保持活跃:
bash
# 保存以下 AppleScript 为 keep-messages-open.scpt
# tell application "Messages" to activate
# 安装 LaunchAgent 定期运行(防止 Messages.app 被挂起)
# 详见 docs.openclaw.ai/channels/bluebubblesiMessage vs WhatsApp:哪个更适合你?
| 对比 | iMessage + BlueBubbles | |
|---|---|---|
| 平台 | 仅 Apple 生态 | 全平台 |
| 需要 Mac | ✅ 必须 | ❌ 不需要 |
| 设置复杂度 | 高(需要 Mac 常开) | 中(QR 扫码) |
| 国内使用 | ✅ 无封锁 | ⚠️ 部分地区受限 |
| 媒体支持 | ✅ 完整 | ✅ 完整 |
来源:OpenClaw 官方文档 - docs.openclaw.ai/channels/bluebubbles