iOS 應用程式(Node)
OpenClaw iOS 應用程式的說明文件,作為節點連接至 Gateway,提供 Canvas、Camera、Location 及語音功能。
可用性:內部預覽。iOS 應用程式尚未公開發行。
功能介紹
- 透過 WebSocket 連接至 Gateway(LAN 或 tailnet)。
- 公開節點功能:Canvas、Screen snapshot、Camera capture、Location、Talk mode、Voice wake。
- 接收
node.invoke指令並回報節點狀態事件。
系統需求
- Gateway 在另一台裝置上執行(macOS、Linux 或 Windows via WSL2)。
- 網路路徑:
- 同一 LAN,透過 Bonjour,或
- Tailnet,透過 unicast DNS-SD(範例網域:
openclaw.internal.),或 - 手動輸入 host/port(備援方式)。
快速入門(配對 + 連線)
- 啟動 Gateway:
openclaw gateway --port 18789
-
在 iOS 應用程式中,開啟 Settings 並選擇已發現的 gateway(或啟用 Manual Host 並輸入 host/port)。
-
在 Gateway 主機上核准配對請求:
openclaw nodes pending
openclaw nodes approve <requestId>
- 驗證連線:
openclaw nodes status
openclaw gateway call node.list --params "{}"
探索路徑
Bonjour(LAN)
Gateway 在 local. 上公告 _openclaw-gw._tcp。iOS 應用程式會自動列出這些項目。
Tailnet(跨網路)
如果 mDNS 被阻擋,請使用 unicast DNS-SD 區域(選擇一個網域;範例:openclaw.internal.)和 Tailscale split DNS。
請參閱 Bonjour 了解 CoreDNS 範例。
手動 host/port
在 Settings 中啟用 Manual Host,輸入 gateway host + port(預設 18789)。
Canvas + A2UI
iOS 節點會渲染 WKWebView canvas。使用 node.invoke 來驅動它:
openclaw nodes invoke --node "iOS Node" --command canvas.navigate --params '{"url":"http://<gateway-host>:18789/__openclaw__/canvas/"}'
注意事項:
- Gateway canvas host 提供
/__openclaw__/canvas/和/__openclaw__/a2ui/。 - 它由 Gateway HTTP 伺服器提供服務(與
gateway.port相同的連接埠,預設18789)。 - iOS 節點在連線時,如果 canvas host URL 已公告,會自動導覽至 A2UI。
- 使用
canvas.navigate和{"url":""}可返回內建的 scaffold。
Canvas eval / snapshot
openclaw nodes invoke --node "iOS Node" --command canvas.eval --params '{"javaScript":"(() => { const {ctx} = window.__openclaw; ctx.clearRect(0,0,innerWidth,innerHeight); ctx.lineWidth=6; ctx.strokeStyle=\"#ff2d55\"; ctx.beginPath(); ctx.moveTo(40,40); ctx.lineTo(innerWidth-40, innerHeight-40); ctx.stroke(); return \"ok\"; })()"}'
openclaw nodes invoke --node "iOS Node" --command canvas.snapshot --params '{"maxWidth":900,"format":"jpeg"}'
Voice wake + Talk mode
- Voice wake 和 Talk mode 可在 Settings 中使用。
- iOS 可能會暫停背景音訊;當應用程式不在前景時,語音功能僅能盡力而為。
常見錯誤
NODE_BACKGROUND_UNAVAILABLE:將 iOS 應用程式帶到前景(canvas/camera/screen 指令需要前景執行)。A2UI_HOST_NOT_CONFIGURED:Gateway 未公告 canvas host URL;請檢查 Gateway configuration 中的canvasHost。- 配對提示未出現:執行
openclaw nodes pending並手動核准。 - 重新安裝後無法重新連線:Keychain 配對 token 已清除;請重新配對節點。