Android手机安装配置OpenClaw
适用于:Huawei / Android 手机 + Termux + Ubuntu (proot-distro) 环境,其它安卓手机理论上也可以。
·
安卓手机安装配置 OpenClaw 龙虾养起来
适用于:Huawei / Android 手机 + Termux + Ubuntu (proot-distro) 环境,其它安卓手机理论上也可以
一、环境架构
Huawei Phone
│
Termux
│
Ubuntu (proot-distro)
│
OpenClaw
│
LLM API (Gemini / DeepSeek / OpenAI)
│
Telegram Bot
│
消息推送到手机
OpenClaw 作用:
- Agent 调度
- Cron 定时任务
- 调用 LLM API
- 调用 Telegram API
OpenClaw 不运行大模型,只是代理与自动化控制层。
二、安装 Termux
建议使用 F-Droid 版本。
初始化:
pkg update
pkg upgrade
pkg install git curl wget nodejs
三、安装 Ubuntu
pkg install proot-distro
proot-distro install ubuntu
进入 Ubuntu:
proot-distro login ubuntu
更新系统:
apt update
apt upgrade
四、安装 Node.js
apt install nodejs npm
检查版本:
node -v
# v22.13.1#
npm -v
建议:
Node >= 18
五、安装 OpenClaw
npm install -g openclaw
检查:
openclaw --version
六、启动 OpenClaw
openclaw start
# 暴露到本机ssh主机
ssh -L 18789:127.0.0.1:18789 root@{openclawhost} -p 8022
Web UI:
http://localhost:18789
七、创建 Agent
建议创建专门 Agent:
Name: news-bot
Description: Daily news sender
建议配置:
配置 建议
Model gemini-1.5-flash
Memory 关闭
Tools HTTP
八、配置 Telegram Bot
创建 Bot
在 Telegram 搜索 BotFather:
/newbot
输入bot的名称
输入bot的订阅id
获取到bot token
获得:
BOT_TOKEN
点击bot的订阅id,开始对话
获取 Chat ID
给 Bot 发消息,然后:
curl https://api.telegram.org/bot<BOT_TOKEN>/getUpdates
返回:
{
"chat": {
"id": 123456789
}
}
记录:
CHAT_ID
九、添加 Telegram 工具
{
"name": "sendTelegram",
"type": "http",
"description": "Send message to telegram",
"config": {
"method": "POST",
"url": "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage",
"headers": {
"Content-Type": "application/json"
},
"bodyTemplate": {
"chat_id": "${CHAT_ID}",
"text": "{{message}}"
}
}
}
环境变量:
BOT_TOKEN=xxxx
CHAT_ID=xxxx
十、创建 Cron 定时任务
payload.kind = agentTurn
示例:
{
"schedule": "0 8 * * *",
"isolated": true,
"payload": {
"kind": "agentTurn",
"agentId": "news-bot",
"input": {
"content": "总结今天全球最重要的5条新闻,每条不超过60字,然后调用 sendTelegram 工具发送。"
}
}
}
十一、常见错误
cron 保存报错
isolated cron jobs require payload.kind="agentTurn"
解决:
kind = agentTurn
任务超时
cron: job execution timed out
解决:
- 使用 gemini-1.5-flash
- 限制输出字数
- 使用独立 agent
Browser Gateway Timeout
gateway timeout after 1500ms
ws://127.0.0.1:18789
关闭 browser:
{
"browser": {
"enabled": false
}
}
十二、推荐架构
OpenClaw
├─ main (聊天)
├─ news-bot (新闻 cron)
└─ alert-bot (监控告警)
十三、自动化流程
Cron
↓
Agent
↓
LLM
↓
Telegram API
↓
手机收到消息
十四、安全建议
- 不要公开 Bot Token\
- Token 放环境变量\
- 不要写入 Prompt\
- 定期 rotate token
OpenClaw 可以作为 自动化消息中心。
更多推荐




所有评论(0)