Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

android-phone-openclaw / 旧安卓手机焕新

Give your old Android phone a second life — as a silent, low-power Linux dev server running AI agents. No root required.

让吃灰的旧安卓手机重获新生——变成一台静音、低功耗、能跑 AI Agent 的 Linux 开发服务器。无需 root。


🇬🇧 English

What this is

A reproducible recipe (plus a ZCode skill, scripts, and a battle-tested troubleshooting guide) for turning a discarded Android phone into a usable Linux environment that runs modern AI agents like hermes-agent.

The project was born from a real session: reviving a 2020 Smartisan Nut R2 (Snapdragon 865, Android 8.1) to run hermes-agent v0.18. Every trap in references/troubleshooting.md was hit and solved for real — not theoretical.

Why it's non-trivial

Running a 2025 AI agent on an old phone hits a stack of compounding issues:

  1. USB/ADB — charge-only cables, sandbox isolation
  2. Termux Python 3.14 — too new; agents need 3.11–3.13
  3. Rust on Androidrustup doesn't support the aarch64-unknown-linux-android target, so cryptography / uv can't build
  4. Docker Hub blocked in Chinaproot-distro install fails even when GitHub works
  5. GitHub clone flakiness — SSL resets at 99%
  6. PyPI slowness — and uv doesn't read pip.conf
  7. Smartisan OS blocks root — no OEM-unlock toggle, no fastboot driver, no rescue. Don't try; use proot. (§ 10)
  8. hermes MCP config is interactivehermes mcp add can't be driven remotely; write config files directly. (§ 12)
  9. Slow in-phone downloads — download on PC, push via adb. (§ 11, § 13)

This repo gives you the proven path through all of them.

Repo layout

.
├── README.md # this file ( bilingual )
├── skill/
│ ├── SKILL.md # the ZCode skill — full installation workflow
│ └── scripts/
│ ├── serve.py # Termux-side socket executor (paste once, run)
│ └── send_cmd.ps1 # PC-side PowerShell client (pairs with serve.py)
└── references/
 └── troubleshooting.md # every trap hit, with symptom + cause + fix

Quick start

  1. Read skill/SKILL.md top-to-bottom — it's the complete workflow in 5 phases.
  2. If anything breaks, jump to references/troubleshooting.md before improvising — the symptom→fix table at the bottom is your friend.

The high-level path:

data cable + USB debugging
 → ADB + scrcpy (PC mirrors & controls phone)
 → Termux + serve.py (PC drives Termux remotely)
 → proot-distro Ubuntu (escapes Termux's Python 3.14 / Rust-on-Android trap)
 → uv + Python 3.11 + hermes-agent

Who this is for

  • People with an old Android phone collecting dust (5+ years old is fine)
  • Tinkerers who want a headless dev box / always-on AI agent host
  • Anyone in China who's fought Termux + Docker Hub + GitHub and lost

Tested on

  • Smartisan Nut R2 (DE106) / Snapdragon 865 / Android 8.1.0
  • Windows 11 host (the PowerShell scripts; the skill itself is platform-agnostic)

🇨🇳 中文

这是什么

一套可复现的方案(包含一个 ZCode skill、辅助脚本、以及一份从实战中淬炼出的故障排查手册),把吃灰的旧安卓手机变成能跑现代 AI Agent(如 hermes-agent)的 Linux 环境。

本项目源于一次真实操作:让一台 2020 年的锤子坚果 R2(骁龙 865,Android 8.1)跑起 hermes-agent v0.18。references/troubleshooting.md 里每一个坑都是实打实踩过并解决的——不是纸上谈兵。

为什么这件事不简单

在旧手机上跑 2025 年的 AI Agent,会撞上一连串叠加的问题:

  1. USB/ADB——充电线不传数据、沙箱隔离
  2. Termux 的 Python 3.14 太新——Agent 需要 3.11–3.13
  3. Rust 不支持 Android 目标——rustup 不支持 aarch64-unknown-linux-android,导致 cryptography / uv 编不出来
  4. 国内 Docker Hub 被墙——proot-distro install 失败,即便 GitHub 能通
  5. GitHub 克隆不稳——下到 99% 时 SSL 重置
  6. PyPI 下载慢——而且 uv 不读 pip.conf
  7. 锤子 Smartisan OS 封锁 root——没有 OEM 解锁开关、没有 fastboot 驱动、无官方救砖。别试,用 proot。(§ 10)
  8. hermes 的 MCP 配置是交互式的——hermes mcp add 远程喂不进输入,要直接写配置文件。(§ 12)
  9. 手机端下载慢——电脑下好,adb 推过去。(§ 11、§ 13)

本仓库给你一条已被验证的穿越所有这些坑的路径。

仓库结构

.
├── README.md # 本文件(中英双语)
├── skill/
│ ├── SKILL.md # ZCode skill —— 完整安装流程(5个阶段)
│ └── scripts/
│ ├── serve.py # Termux 端 socket 执行器(粘贴一次,运行)
│ └── send_cmd.ps1 # PC 端 PowerShell 客户端(配对 serve.py)
└── references/
 └── troubleshooting.md # 所有踩过的坑,按 症状→根因→解决 组织

快速上手

  1. 从头到尾读一遍 skill/SKILL.md ——5 个阶段的完整流程都在里面。
  2. 任何环节出错,先查 references/troubleshooting.md 再动手——文末的"症状→条目"速查表是利器。

整体路径:

数据线 + USB 调试
 → ADB + scrcpy(PC 投屏并控制手机)
 → Termux + serve.py(PC 远程驱动 Termux)
 → proot-distro Ubuntu(绕开 Termux 的 Python 3.14 / Rust-on-Android 死结)
 → uv + Python 3.11 + hermes-agent

适用对象

  • 有吃灰旧安卓手机的人(5 年以上机龄没问题)
  • 想要一台无头开发机 / ×ばつ24 小时 AI Agent 宿主的爱折腾者
  • 国内被 Termux + Docker Hub + GitHub 折磨过的人

实测环境

  • 锤子坚果 R2(DE106)/ 骁龙 865 / Android 8.1.0
  • Windows 11 主机(PowerShell 脚本针对它;skill 本身跨平台)

License / 许可

MIT — do whatever, just don't blame me if you brick your phone (you won't, this recipe is root-free and reversible).

MIT——随便用。万一搞坏手机别找我(不会的,本方案免 root、完全可逆)。

About

Give your old Android phone a second life — as a silent Linux dev box running AI agents (hermes-agent). No root. 旧安卓手机焕新,变成跑 AI Agent 的 Linux 服务器,免 root。

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /