{"id":185,"date":"2026-03-21T22:47:21","date_gmt":"2026-03-21T14:47:21","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-android\/"},"modified":"2026-03-21T23:08:52","modified_gmt":"2026-03-21T15:08:52","slug":"platforms-android","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-android\/","title":{"rendered":"Android \u5e94\u7528"},"content":{"rendered":"<h1>Android \u5e94\u7528<\/h1>\n<h1>Android \u5e94\u7528\uff08\u8282\u70b9\uff09<\/h1>\n<h2>\u652f\u6301\u6982\u89c8<\/h2>\n<ul>\n<li>\u89d2\u8272\uff1a\u914d\u5957\u8282\u70b9\u5e94\u7528\uff08Android \u4e0d\u6258\u7ba1 Gateway \u7f51\u5173\uff09\u3002<\/li>\n<li>\u9700\u8981 Gateway \u7f51\u5173\uff1a\u662f\uff08\u5728 macOS\u3001Linux \u6216\u901a\u8fc7 WSL2 \u7684 Windows \u4e0a\u8fd0\u884c\uff09\u3002<\/li>\n<li>\u5b89\u88c5\uff1a<a href=\"\/start\/getting-started\">\u5165\u95e8\u6307\u5357<\/a> + <a href=\"\/gateway\/pairing\">\u914d\u5bf9<\/a>\u3002<\/li>\n<li>Gateway \u7f51\u5173\uff1a<a href=\"\/gateway\">\u64cd\u4f5c\u624b\u518c<\/a> + <a href=\"\/gateway\/configuration\">\u914d\u7f6e<\/a>\u3002<\/li>\n<li>\u534f\u8bae\uff1a<a href=\"\/gateway\/protocol\">Gateway \u7f51\u5173\u534f\u8bae<\/a>\uff08\u8282\u70b9 + \u63a7\u5236\u5e73\u9762\uff09\u3002<\/li>\n<\/ul>\n<h2>\u7cfb\u7edf\u63a7\u5236<\/h2>\n<p>\u7cfb\u7edf\u63a7\u5236\uff08launchd\/systemd\uff09\u4f4d\u4e8e Gateway \u7f51\u5173\u4e3b\u673a\u4e0a\u3002\u53c2\u89c1 <a href=\"\/gateway\">Gateway \u7f51\u5173<\/a>\u3002<\/p>\n<h2>\u8fde\u63a5\u64cd\u4f5c\u624b\u518c<\/h2>\n<p>Android \u8282\u70b9\u5e94\u7528 \u21c4\uff08mDNS\/NSD + WebSocket\uff09\u21c4 <strong>Gateway \u7f51\u5173<\/strong><\/p>\n<p>Android \u76f4\u63a5\u8fde\u63a5\u5230 Gateway \u7f51\u5173 WebSocket\uff08\u9ed8\u8ba4 <code>ws:\/\/&lt;host&gt;:18789<\/code>\uff09\u5e76\u4f7f\u7528 Gateway \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9\u3002<\/p>\n<h3>\u524d\u7f6e\u6761\u4ef6<\/h3>\n<ul>\n<li>\u4f60\u53ef\u4ee5\u5728&#8221;\u4e3b&#8221;\u673a\u5668\u4e0a\u8fd0\u884c Gateway \u7f51\u5173\u3002<\/li>\n<li>Android \u8bbe\u5907\/\u6a21\u62df\u5668\u53ef\u4ee5\u8bbf\u95ee Gateway \u7f51\u5173 WebSocket\uff1a<\/li>\n<li>\u4f7f\u7528 mDNS\/NSD \u7684\u540c\u4e00\u5c40\u57df\u7f51\uff0c<strong>\u6216<\/strong><\/li>\n<li>\u4f7f\u7528 Wide-Area Bonjour \/ unicast DNS-SD \u7684\u540c\u4e00 Tailscale tailnet\uff08\u89c1\u4e0b\u6587\uff09\uff0c<strong>\u6216<\/strong><\/li>\n<li>\u624b\u52a8 Gateway \u7f51\u5173\u4e3b\u673a\/\u7aef\u53e3\uff08\u56de\u9000\u65b9\u6848\uff09<\/li>\n<li>\u4f60\u53ef\u4ee5\u5728 Gateway \u7f51\u5173\u673a\u5668\u4e0a\u8fd0\u884c CLI\uff08<code>openclaw<\/code>\uff09\uff08\u6216\u901a\u8fc7 SSH\uff09\u3002<\/li>\n<\/ul>\n<h3>1\uff09\u542f\u52a8 Gateway \u7f51\u5173<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw gateway &#8211;port 18789 &#8211;verbose<\/p>\n<pre><code>\n\u5728\u65e5\u5fd7\u4e2d\u786e\u8ba4\u4f60\u770b\u5230\u7c7b\u4f3c\u5185\u5bb9\uff1a\n\n* `listening on ws:\/\/0.0.0.0:18789`\n\n\u5bf9\u4e8e\u4ec5 tailnet \u8bbe\u7f6e\uff08\u63a8\u8350\u7528\u4e8e\u7ef4\u4e5f\u7eb3 \u21c4 \u4f26\u6566\uff09\uff0c\u5c06 Gateway \u7f51\u5173\u7ed1\u5b9a\u5230 tailnet IP\uff1a\n\n* \u5728 Gateway \u7f51\u5173\u4e3b\u673a\u7684 `~\/.openclaw\/openclaw.json` \u4e2d\u8bbe\u7f6e `gateway.bind: &quot;tailnet&quot;`\u3002\n* \u91cd\u542f Gateway \u7f51\u5173 \/ macOS \u83dc\u5355\u680f\u5e94\u7528\u3002\n\n### 2\uff09\u9a8c\u8bc1\u53d1\u73b0\uff08\u53ef\u9009\uff09\n\n\u4ece Gateway \u7f51\u5173\u673a\u5668\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\ndns-sd -B _openclaw-gw._tcp local.\n<\/code><\/pre>\n<p>\u66f4\u591a\u8c03\u8bd5\u8bf4\u660e\uff1a<a href=\"\/gateway\/bonjour\">Bonjour<\/a>\u3002<\/p>\n<h4>\u901a\u8fc7 unicast DNS-SD \u7684 Tailnet\uff08\u7ef4\u4e5f\u7eb3 \u21c4 \u4f26\u6566\uff09\u53d1\u73b0<\/h4>\n<p>Android NSD\/mDNS \u53d1\u73b0\u65e0\u6cd5\u8de8\u7f51\u7edc\u3002\u5982\u679c\u4f60\u7684 Android \u8282\u70b9\u548c Gateway \u7f51\u5173\u5728\u4e0d\u540c\u7f51\u7edc\u4f46\u901a\u8fc7 Tailscale \u8fde\u63a5\uff0c\u8bf7\u6539\u7528 Wide-Area Bonjour \/ unicast DNS-SD\uff1a<\/p>\n<ol>\n<li>\u5728 Gateway \u7f51\u5173\u4e3b\u673a\u4e0a\u8bbe\u7f6e DNS-SD \u533a\u57df\uff08\u793a\u4f8b <code>openclaw.internal.<\/code>\uff09\u5e76\u53d1\u5e03 <code>_openclaw-gw._tcp<\/code> \u8bb0\u5f55\u3002<\/li>\n<li>\u914d\u7f6e Tailscale split DNS\uff0c\u5c06\u4f60\u9009\u62e9\u7684\u57df\u6307\u5411\u8be5 DNS \u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n<p>\u8be6\u60c5\u548c\u793a\u4f8b CoreDNS \u914d\u7f6e\uff1a<a href=\"\/gateway\/bonjour\">Bonjour<\/a>\u3002<\/p>\n<h3>3\uff09\u4ece Android \u8fde\u63a5<\/h3>\n<p>\u5728 Android \u5e94\u7528\u4e2d\uff1a<\/p>\n<ul>\n<li>\u5e94\u7528\u901a\u8fc7<strong>\u524d\u53f0\u670d\u52a1<\/strong>\uff08\u6301\u4e45\u901a\u77e5\uff09\u4fdd\u6301 Gateway \u7f51\u5173\u8fde\u63a5\u6d3b\u52a8\u3002<\/li>\n<li>\u6253\u5f00<strong>\u8bbe\u7f6e<\/strong>\u3002<\/li>\n<li>\u5728<strong>\u53d1\u73b0\u7684 Gateway \u7f51\u5173<\/strong>\u4e0b\uff0c\u9009\u62e9\u4f60\u7684 Gateway \u7f51\u5173\u5e76\u70b9\u51fb<strong>\u8fde\u63a5<\/strong>\u3002<\/li>\n<li>\u5982\u679c mDNS \u88ab\u963b\u6b62\uff0c\u4f7f\u7528<strong>\u9ad8\u7ea7 \u2192 \u624b\u52a8 Gateway \u7f51\u5173<\/strong>\uff08\u4e3b\u673a + \u7aef\u53e3\uff09\u5e76<strong>\u8fde\u63a5\uff08\u624b\u52a8\uff09<\/strong>\u3002<\/li>\n<\/ul>\n<p>\u9996\u6b21\u6210\u529f\u914d\u5bf9\u540e\uff0cAndroid \u5728\u542f\u52a8\u65f6\u81ea\u52a8\u91cd\u8fde\uff1a<\/p>\n<ul>\n<li>\u624b\u52a8\u7aef\u70b9\uff08\u5982\u679c\u542f\u7528\uff09\uff0c\u5426\u5219<\/li>\n<li>\u4e0a\u6b21\u53d1\u73b0\u7684 Gateway \u7f51\u5173\uff08\u5c3d\u529b\u800c\u4e3a\uff09\u3002<\/li>\n<\/ul>\n<h3>4\uff09\u6279\u51c6\u914d\u5bf9\uff08CLI\uff09<\/h3>\n<p>\u5728 Gateway \u7f51\u5173\u673a\u5668\u4e0a\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw nodes pending<br \/>\nopenclaw nodes approve <\/p>\n<pre><code>\n\u914d\u5bf9\u8be6\u60c5\uff1a[Gateway \u7f51\u5173\u914d\u5bf9](\/gateway\/pairing)\u3002\n\n### 5\uff09\u9a8c\u8bc1\u8282\u70b9\u5df2\u8fde\u63a5\n\n* \u901a\u8fc7\u8282\u70b9\u72b6\u6001\uff1a\n  ```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n  openclaw nodes status\n  ```\n* \u901a\u8fc7 Gateway \u7f51\u5173\uff1a\n  ```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n  openclaw gateway call node.list --params &quot;{}&quot;\n  ```\n\n### 6\uff09\u804a\u5929 + \u5386\u53f2\n\nAndroid \u8282\u70b9\u7684 Chat \u9762\u677f\u4f7f\u7528 Gateway \u7f51\u5173\u7684**\u4e3b\u4f1a\u8bdd\u952e**\uff08`main`\uff09\uff0c\u56e0\u6b64\u5386\u53f2\u548c\u56de\u590d\u4e0e WebChat \u548c\u5176\u4ed6\u5ba2\u6237\u7aef\u5171\u4eab\uff1a\n\n* \u5386\u53f2\uff1a`chat.history`\n* \u53d1\u9001\uff1a`chat.send`\n* \u63a8\u9001\u66f4\u65b0\uff08\u5c3d\u529b\u800c\u4e3a\uff09\uff1a`chat.subscribe` \u2192 `event:&quot;chat&quot;`\n\n### 7\uff09Canvas + \u6444\u50cf\u5934\n\n#### Gateway \u7f51\u5173 Canvas \u4e3b\u673a\uff08\u63a8\u8350\u7528\u4e8e web \u5185\u5bb9\uff09\n\n\u5982\u679c\u4f60\u60f3\u8ba9\u8282\u70b9\u663e\u793a\u667a\u80fd\u4f53\u53ef\u4ee5\u5728\u78c1\u76d8\u4e0a\u7f16\u8f91\u7684\u771f\u5b9e HTML\/CSS\/JS\uff0c\u8bf7\u5c06\u8282\u70b9\u6307\u5411 Gateway \u7f51\u5173 canvas \u4e3b\u673a\u3002\n\n\u6ce8\u610f\uff1a\u8282\u70b9\u4f7f\u7528 `canvasHost.port`\uff08\u9ed8\u8ba4 `18793`\uff09\u4e0a\u7684\u72ec\u7acb canvas \u4e3b\u673a\u3002\n\n1. \u5728 Gateway \u7f51\u5173\u4e3b\u673a\u4e0a\u521b\u5efa `~\/.openclaw\/workspace\/canvas\/index.html`\u3002\n\n2. \u5c06\u8282\u70b9\u5bfc\u822a\u5230\u5b83\uff08\u5c40\u57df\u7f51\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw nodes invoke --node &quot;&lt;Android Node&gt;&quot; --command canvas.navigate --params '{&quot;url&quot;:&quot;http:\/\/&lt;gateway-hostname&gt;.local:18793\/__openclaw__\/canvas\/&quot;}'\n<\/code><\/pre>\n<p>Tailnet\uff08\u53ef\u9009\uff09\uff1a\u5982\u679c\u4e24\u4e2a\u8bbe\u5907\u90fd\u5728 Tailscale \u4e0a\uff0c\u4f7f\u7528 MagicDNS \u540d\u79f0\u6216 tailnet IP \u800c\u4e0d\u662f <code>.local<\/code>\uff0c\u4f8b\u5982 <code>http:\/\/&lt;gateway-magicdns&gt;:18793\/__openclaw__\/canvas\/<\/code>\u3002<\/p>\n<p>\u6b64\u670d\u52a1\u5668\u5c06\u5b9e\u65f6\u91cd\u8f7d\u5ba2\u6237\u7aef\u6ce8\u5165 HTML \u5e76\u5728\u6587\u4ef6\u66f4\u6539\u65f6\u91cd\u65b0\u52a0\u8f7d\u3002<br \/>\nA2UI \u4e3b\u673a\u4f4d\u4e8e <code>http:\/\/&lt;gateway-host&gt;:18793\/__openclaw__\/a2ui\/<\/code>\u3002<\/p>\n<p>Canvas \u547d\u4ee4\uff08\u4ec5\u524d\u53f0\uff09\uff1a<\/p>\n<ul>\n<li><code>canvas.eval<\/code>\u3001<code>canvas.snapshot<\/code>\u3001<code>canvas.navigate<\/code>\uff08\u4f7f\u7528 <code>{\"url\":\"\"}<\/code> \u6216 <code>{\"url\":\"\/\"}<\/code> \u8fd4\u56de\u9ed8\u8ba4\u811a\u624b\u67b6\uff09\u3002<code>canvas.snapshot<\/code> \u8fd4\u56de <code>{ format, base64 }<\/code>\uff08\u9ed8\u8ba4 <code>format=\"jpeg\"<\/code>\uff09\u3002<\/li>\n<li>A2UI\uff1a<code>canvas.a2ui.push<\/code>\u3001<code>canvas.a2ui.reset<\/code>\uff08<code>canvas.a2ui.pushJSONL<\/code> \u9057\u7559\u522b\u540d\uff09<\/li>\n<\/ul>\n<p>\u6444\u50cf\u5934\u547d\u4ee4\uff08\u4ec5\u524d\u53f0\uff1b\u6743\u9650\u9650\u5236\uff09\uff1a<\/p>\n<ul>\n<li><code>camera.snap<\/code>\uff08jpg\uff09<\/li>\n<li><code>camera.clip<\/code>\uff08mp4\uff09<\/li>\n<\/ul>\n<p>\u53c2\u89c1 <a href=\"\/nodes\/camera\">Camera \u8282\u70b9<\/a> \u4e86\u89e3\u53c2\u6570\u548c CLI \u52a9\u624b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android \u5e94\u7528 Android \u5e94\u7528\uff08\u8282\u70b9\uff09 \u652f\u6301\u6982\u89c8 \u89d2\u8272\uff1a\u914d\u5957\u8282\u70b9\u5e94\u7528\uff08Android \u4e0d\u6258\u7ba1 Ga [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/185\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}