Install
openclaw skills install clawmobileClawMobile - 完整的 Android 自动化工具包,深度集成 AutoX.js。 提供工作流管理、任务录制、AI 智能干预、会员系统、HTTP API 通信等完整功能。 支持自动化测试、RPA 流程自动化、移动应用交互等场景。 适用场景:自动化测试、批量操作、流程录制和回放、无人值守任务、移动应用 RPA。
openclaw skills install clawmobile完整的企业级 Android 自动化解决方案,深度集成 AutoX.js,提供强大的工作流管理、任务录制、AI 智能干预和会员系统。
ClawMobile 是一个功能强大的 Android 设备自动化工具包,通过 AutoX.js HTTP 服务器实现完整的设备控制。它将移动自动化、RPA(机器人流程自动化)和 AI 智能决策完美结合,为开发者、测试人员和 RPA 工程师提供全面的自动化解决方案。
当用户提到以下需求时,自动触发此 Skill:
工作流相关:
录制相关:
会员相关:
测试和自动化:
AI 相关:
功能特性:
使用场景:
API 端点:
GET /workflows - 列出所有工作流GET /workflows/{id} - 获取工作流详情POST /workflows - 创建工作流PUT /workflows/{id} - 更新工作流DELETE /workflows/{id} - 删除工作流POST /api/v1/workflows/{id}/validate - 验证工作流功能特性:
使用场景:
API 端点:
POST /recording/start - 开始录制POST /recording/pause - 暂停录制POST /recording/resume - 恢复录制POST /recording/stop - 停止录制功能特性:
使用场景:
API 端点:
POST /intervention - 请求 AI 干预POST /api/v1/parameters/decide - 参数自动决策GET /api/v1/parameters/decisions/stats - 决策统计功能特性:
会员等级对比:
| 功能 | Free | VIP | SVIP |
|---|---|---|---|
| 每日运行次数 | 3 | 无限 | 无限 |
| 定时任务 | ❌ | ✅ | ✅ |
| AI 干预 | ❌ | ✅ | ✅ |
| 导入/导出 | ❌ | ✅ | ✅ |
| 自然语言生成 | ✅ | ✅ | ✅ |
| 参数自动决策 | ❌ | ❌ | ✅ |
| 高级分析 | ❌ | ❌ | ✅ |
兑换码格式:C-VENDORCODE-YY-DDM-CHECKSUM(5 段格式)
API 端点:
GET /api/v1/membership/status - 获取会员状态POST /api/v1/membership/validate - 验证兑换码POST /api/v1/membership/check-permission - 检查权限GET /api/v1/membership/history - 获取历史记录功能特性:
API 端点:
GET /api/v1/health - 健康检查GET /status - 服务器状态POST /execute - 执行任务POST /check_status - 检查状态POST /stop - 停止任务# 安装 ClawMobile Skill
clawhub install clawmobile
# 验证安装
ls -la ~/.openclaw/skills/clawmobile/SKILL.md
# 刷新 OpenClaw
openclaw gateway restart
# 创建技能目录
mkdir -p ~/.openclaw/skills
# 克隆仓库
cd ~/.openclaw/skills
git clone https://gitee.com/your-repo/clawmobile.git clawmobile
# 验证安装
ls -la clawmobile/SKILL.md
# 下载 Skill 包
wget https://github.com/clawmobile/clawmobile/archive/v1.0.0.zip
# 解压到技能目录
unzip v1.0.0.zip -d ~/.openclaw/skills/
mv ~/.openclaw/skills/clawmobile-1.0.0 ~/.openclaw/skills/clawmobile
在 Android 设备上:
# 连接设备
adb devices
# 验证连接
adb shell getprop ro.build.version.sdk
# 转发端口(如需远程访问)
adb forward tcp:8765 tcp:8765
方法 A:使用配置文件
cat > config/settings.yaml << 'EOF'
# API 配置
api:
base_url: "http://localhost:8765"
timeout: 30000
max_retries: 3
retry_delay: 1000
# 服务器配置
server:
host: "0.0.0.0"
port: 8765
workers: 4
# 认证配置
auth:
token_env: "CLAWMOBILE_API_TOKEN"
default_token: "your-autox-token-here"
# 连接配置
connection:
mode: "local"
max_retries: 60
test_interval: 30000
auto_reconnect: true
# 会员配置
membership:
default_tier: "free"
daily_runs:
free: 3
vip: -1
svip: -1
# 录制配置
recording:
default_duration: 300
max_duration: 3600
capture_screenshots: true
capture_ui_tree: true
# 日志配置
logging:
level: "INFO"
file: "clawmobile.log"
max_size: "10MB"
backup_count: 5
EOF
方法 B:使用环境变量
# 设置环境变量
export CLAWMOBILE_API_URL="http://localhost:8765"
export CLAWMOBILE_API_TOKEN="your-autox-token-here"
export CLAWMOBILE_TIMEOUT="30000"
# 或添加到 ~/.bashrc
echo 'export CLAWMOBILE_API_URL="http://localhost:8765"' >> ~/.bashrc
echo 'export CLAWMOBILE_API_TOKEN="your-autox-token-here"' >> ~/.bashrc
source ~/.bashrc
# 测试基本连接
curl http://localhost:8765/api/v1/health
# 预期响应:
# {"success": true, "health": {"status": "healthy", ...}}
# 使用 Python 客户端测试
python3 -c "
from skill.client import ClawMobileClient
client = ClawMobileClient()
health = client.get_health()
print(f'Health: {health}')
"
from skill.client import ClawMobileClient
# 创建客户端
client = ClawMobileClient()
# 1. 列出工作流
workflows = client.list_workflows()
for workflow in workflows:
print(f"{workflow['workflow_name']} - {workflow['workflow_id']}")
# 2. 执行工作流
result = client.execute_workflow(
workflow_id="workflow_001",
params={"keyword": "春天的风景"}
)
print(f"Task ID: {result['task_id']}")
print(f"Status: {result['status']}")
# 3. 开始录制
recording = client.start_recording(
workflow_id="workflow_001",
app_package="com.doubao.app",
options={
"capture_screenshots": True,
"capture_ui_tree": True
}
)
print(f"Recording ID: {recording['recording_id']}")
# 4. 检查会员状态
membership = client.get_membership_status(user_id="user_001")
print(f"Tier: {membership['tier']}")
print(f"Active: {membership['is_active']}")
print(f"Remaining Runs: {membership['today_usage']['runs_remaining']}")
# 设置认证 Token
export TOKEN="your-autox-token-here"
# 健康检查
curl http://localhost:8765/api/v1/health
# 列出工作流
curl -H "Authorization: Bearer $TOKEN" \
http://localhost:8765/workflows
# 执行工作流
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"id":"task_001","workflow_id":"workflow_001"}' \
http://localhost:8765/execute
# 开始录制
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"workflow_id":"workflow_001","app_package":"com.doubao.app"}' \
http://localhost:8765/recording/start
列出所有工作流
响应:
{
"workflows": [
{
"workflow_id": "workflow_001",
"workflow_name": "豆包视频生成+发布",
"kernel_type": "accessibility",
"created_at": "2026-03-29T11:00:00Z",
"run_count": 15,
"success_rate": 93.3
}
]
}
创建工作流
请求:
{
"workflow_name": "新工作流",
"kernel_type": "accessibility",
"description": "工作流描述"
}
响应:
{
"success": true,
"workflow_id": "workflow_002",
"created_at": "2026-03-31T12:00:00Z"
}
执行工作流任务
请求:
{
"id": "task_001",
"type": "sequence",
"kernel_type": "accessibility",
"priority": "normal",
"timeout": 30000,
"workflow_id": "workflow_001",
"params": {
"keyword": "春天的风景"
}
}
响应:
{
"success": true,
"result": {
"task_id": "task_001",
"status": "completed",
"steps_result": [...],
"total_duration_ms": 3200
}
}
开始录制
请求:
{
"workflow_id": "workflow_001",
"app_package": "com.doubao.app",
"kernel_type": "accessibility",
"options": {
"capture_screenshots": true,
"capture_ui_tree": true
}
}
响应:
{
"success": true,
"recording_id": "rec_001",
"started_at": "2026-03-31T12:00:00Z",
"floating_window_enabled": true
}
获取会员状态
参数:
user_id(查询参数):用户 ID响应:
{
"success": true,
"membership": {
"user_id": "user_001",
"tier": "vip",
"is_active": true,
"activated_at": "2026-03-30T14:30:00Z",
"expires_at": "2026-04-30T14:30:00Z"
},
"permissions": {
"max_daily_runs": -1,
"can_schedule": true,
"can_use_ai_intervention": true
},
"today_usage": {
"runs_completed": 2,
"runs_remaining": -1
}
}
验证兑换码
请求:
{
"code": "C-VENDORCODE-24-01M-A1B2C3D4",
"user_id": "user_001"
}
响应:
{
"success": true,
"membership": {
"tier": "vip",
"activated_at": "2026-03-31T12:00:00Z",
"expires_at": "2026-04-30T12:00:00Z"
}
}
详细的 API 文档请参考:docs/API-DOCUMENTATION.md
| 变量名 | 说明 | 默认值 | 必需 |
|---|---|---|---|
CLAWMOBILE_API_URL | API 服务器地址 | http://localhost:8765 | ✅ |
CLAWMOBILE_API_TOKEN | API 认证 Token | - | ✅ |
CLAWMOBILE_TIMEOUT | 请求超时(ms) | 30000 | ❌ |
CLAWMOBILE_MAX_RETRIES | 最大重试次数 | 3 | ❌ |
CLAWMOBILE_DEVICE_ID | 目标设备 ID | - | ❌ |
config/settings.yaml:
# API 配置
api:
base_url: "http://localhost:8765"
timeout: 30000
max_retries: 3
retry_delay: 1000
# 服务器配置
server:
host: "0.0.0.0"
port: 8765
workers: 4
# 认证配置
auth:
token_env: "CLAWMOBILE_API_TOKEN"
default_token: "clawmobile-secret-token-change-in-production"
# 连接配置
connection:
mode: "local"
remote_host: null
max_retries: 60
test_interval: 30000
auto_reconnect: true
# 会员配置
membership:
default_tier: "free"
api_url: "http://localhost:8765"
daily_runs:
free: 3
vip: -1
svip: -1
# 录制配置
recording:
default_duration: 300
max_duration: 3600
capture_screenshots: true
capture_ui_tree: true
# 日志配置
logging:
level: "INFO"
file: "clawmobile.log"
max_size: "10MB"
backup_count: 5
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
场景:自动化执行豆包视频生成工作流
from skill.client import ClawMobileClient
client = ClawMobileClient()
# 执行工作流
result = client.execute_workflow(
workflow_id="workflow_001",
params={
"keyword": "春天的风景",
"duration": 45
}
)
if result['success']:
print("✅ 工作流执行成功")
print(f"Task ID: {result['task_id']}")
print(f"Status: {result['status']}")
print(f"Duration: {result['total_duration_ms']}ms")
else:
print(f"❌ 工作流执行失败: {result.get('error')}")
场景:录制屏幕操作并自动生成工作流
# 开始录制
recording = client.start_recording(
workflow_id="workflow_002",
app_package="com.doubao.app",
options={
"capture_screenshots": True,
"auto_stop": False
}
)
print(f"录制已开始,ID: {recording['recording_id']}")
print("请在设备上执行操作...")
# 等待用户操作
import time
time.sleep(60) # 录制 60 秒
# 停止录制
result = client.stop_recording(
recording_id=recording['recording_id']
)
print(f"录制已完成,捕获 {len(result['recording']['events'])} 个事件")
# 生成工作流
workflow = client.create_workflow_from_recording(
recording_id=recording['recording_id'],
workflow_name="录制的操作"
)
print(f"工作流已创建: {workflow['workflow_id']}")
场景:激活 VIP 会员
# 激活兑换码
result = client.activate_membership(
code="C-VENDORCODE-24-01M-A1B2C3D4",
user_id="user_001"
)
if result['success']:
print("✅ 会员激活成功")
print(f"等级: {result['membership']['tier']}")
print(f"有效期至: {result['membership']['expires_at']}")
# 查看权限
membership = client.get_membership_status("user_001")
print(f"每日运行次数: {membership['permissions']['max_daily_runs']}")
print(f"可使用定时任务: {membership['permissions']['can_schedule']}")
print(f"可使用 AI 干预: {membership['permissions']['can_use_ai_intervention']}")
else:
print(f"❌ 激活失败: {result.get('error')}")
场景:批量执行多个工作流
workflows = [
{"workflow_id": "workflow_001", "params": {"keyword": "春天"}},
{"workflow_id": "workflow_002", "params": {"content": "今日分享"}},
{"workflow_id": "workflow_003", "params": {"style": "技术"}}
]
results = []
for wf in workflows:
try:
result = client.execute_workflow(**wf)
results.append({
"workflow_id": wf['workflow_id'],
"status": "success",
"task_id": result['task_id']
})
print(f"✅ {wf['workflow_id']}: {result['status']}")
except Exception as e:
results.append({
"workflow_id": wf['workflow_id'],
"status": "failed",
"error": str(e)
})
print(f"❌ {wf['workflow_id']}: {e}")
# 统计结果
success_count = sum(1 for r in results if r['status'] == 'success')
print(f"\n完成: {success_count}/{len(workflows)}")
场景:启用 AI 干预模式处理未知页面
# 执行工作流时启用 AI 干预
result = client.execute_workflow(
workflow_id="workflow_001",
params={"keyword": "测试"},
options={
"enable_ai_intervention": True,
"ai_intervention_threshold": 0.7
}
)
# 查看 AI 决策统计
stats = client.get_ai_decision_stats()
print(f"总决策次数: {stats['total_decisions']}")
print(f"成功率: {stats['success_rate']}%")
print(f"平均响应时间: {stats['avg_response_time']}ms")
症状:
ConnectionError: Failed to connect to API server
解决方案:
检查 AutoX.js 是否运行:
adb shell ps | grep autojs
检查服务器端口:
adb shell netstat -an | grep 8765
验证连接:
curl http://localhost:8765/api/v1/health
检查 ADB 连接:
adb devices
重启 AutoX.js HTTP 服务器
症状:
PermissionError: Feature requires VIP membership
解决方案:
检查当前会员等级:
membership = client.get_membership_status("user_001")
print(f"Current tier: {membership['tier']}")
激活会员或升级:
result = client.activate_membership("VIP-2024-ABCD1234")
检查权限:
permission = client.check_permission("user_001", "can_use_ai_intervention")
print(f"Permission granted: {permission['granted']}")
症状:
WorkflowExecutionError: Task execution failed
诊断步骤:
查看详细错误信息:
result = client.execute_workflow(
workflow_id="workflow_001",
debug=True
)
print(result.get('error'))
检查工作流状态:
workflow = client.get_workflow("workflow_001")
print(f"Status: {workflow['status']}")
print(f"Success Rate: {workflow['success_rate']}%")
验证参数配置:
validation = client.validate_workflow("workflow_001")
print(f"Valid: {validation['is_valid']}")
print(f"Errors: {validation.get('errors', [])}")
查看日志:
tail -f clawmobile.log
症状:
InvalidCodeError: Redeem code format invalid or expired
解决方案:
验证兑换码格式:
# 正确格式:C-VENDORCODE-24-01M-A1B2C3D4
# 5 段:类型-供应商-年份-时长-校验和
from skill.membership import validate_redeem_code_format
is_valid = validate_redeem_code_format("C-VENDORCODE-24-01M-A1B2C3D4")
print(f"Format valid: {is_valid}")
检查兑换码是否已使用:
result = client.validate_redeem_code("C-VENDORCODE-24-01M-A1B2C3D4", "user_001")
print(f"Already used: {result.get('already_used', False)}")
联系管理员获取新的兑换码
获取帮助:
# 查看文档
cat clawmobile/docs/API-DOCUMENTATION.md
cat clawmobile/README.md
# 查看日志
cat clawmobile/clawmobile.log
# 运行测试
cd clawmobile
python3 -m pytest tests/
联系支持:
npm install -g clawhubclawhub --help/usr/lib/node_modules/openclaw/docs/creating-skills.md/usr/lib/node_modules/openclaw/docs/tools/clawhub.md| 版本 | 日期 | 变更内容 |
|---|---|---|
| 1.0.0 | 2026-03-31 | 初始版本:完整的 ClawMobile Skill |
欢迎贡献!请遵循以下步骤:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)MIT License - 详见 LICENSE 文件
ClawMobile 是一个功能完整、生产就绪的 Android 自动化 Skill。通过本 SKILL.md,您应该能够:
下一步:
docs/API-DOCUMENTATION.mddocs/examples/ClawMobile SKILL.md v1.0.0 | Last Updated: 2026-03-31 | Status: Production Ready