仓库:google/artemis · 协议:Apache 2.0 · Python 3.12+ · 内置 MCP
前言
做移动端测试或重复性操作时,常见路径是写 Appium / UIAutomator 脚本:维护成本高、界面一改就挂。
Artemis 是 Google 开源的 Android 自主移动 Agent:你用自然语言描述目标,系统在 真机或模拟器 上完成点击、滑动、输入,并在 Web 控制台里回放每一步推理与截图。
我在 Windows 上接 红米 K80,用 OpenRouter + DeepSeek 视觉模型,完成了 山姆会员商店 App 里「进商品 → 分享 → 生成图片 → 存相册」的全流程。本文结合官方能力说明与一次真实跑通经历,介绍 项目定位、架构、界面与使用方式。
Artemis 是什么?解决什么问题?
一句话:让 AI 像测试工程师一样操作手机。
在 AndroidWorld 基准上官方宣称 99%+ 任务完成率(见 README),适合探索 AI 驱动 UI 测试、重复业务流自动化、Bug 复现 等场景。
整体架构(从浏览器到手机)
┌─────────────────────────────────────────────────────────────┐
│ Showcase UI (Angular) http://localhost:8000 │
│ · Setup 向导 · 任务下发 · Workspace 回放 │
└───────────────────────────┬─────────────────────────────────┘
│ REST / SSE
┌───────────────────────────▼─────────────────────────────────┐
│ Admin Console (FastAPI) · /docs OpenAPI │
│ · 任务队列 · 会话/步骤/用量 · 设备流 · 诊断 │
└───────────────────────────┬─────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
FlashRunner Pro LangGraph MCP Server
(观察-思考-行动) Planner/Operator/ (IDE 调 mobile_* 工具)
Checker/Explorer...
└───────────────────┬───────────────────┘
▼
UnifiedMobileController + ADB
▼
Android 真机 / 模拟器
依赖链(本机):
- Python 3.12+,推荐 uv 管理 .venv 与依赖(uv sync / uv run)
- ADB:设备连接与调试
- scrcpy + FFmpeg(可选):投屏与录屏回放
- 多模态 LLM:Gemini / OpenAI / Claude / OpenRouter 等,在 config/artemis.jsonc + .env 配置
设备侧:
- 优先 Accessibility Helper(更稳的元素树);装不上时回退 UIAutomator2(小米等需开 USB 安装/安全调试)
启动后你会看到哪些页面?
1. 主页 http://localhost:8000
- System Setup & Prerequisites:Python、ADB、API Key、设备连接、模型配置(Gemini 向导或 Custom + artemis.jsonc)
- Launch Autonomous Task:输入任务,选 Flash / Pro,Run Task
- Recommended Tasks:Maps、Gmail、小红书等示例,可一键填入 Prompt
黄条 Prerequisites incomplete 表示:缺 Key、没连设备或设备锁屏等,点 Setup Guide 逐项修。
2. Workspace /workspace
任务运行与复盘主战场:
- 左侧:逐步推理(Work、Tapping Element、坐标/索引)、Token 上下文规模
- 右侧:Task Queue(RUNNING / COMPLETED / FAILED)
- 顶部:Architecture: Flash、录屏状态、Step Replay
适合看 Agent 为什么点偏、如何返回重试。
3. API 文档 http://localhost:8000/docs
Artemis Admin & Trace Console:OpenAPI 3.1,含 sessions、steps、usage、设备流、图片/视频 Trace 等,便于二次集成或查 单次会话 Token(GET /api/sessions/{id}/usage)。
4. Admin Debug http://localhost:8000/admin
偏调试:会话列表、Filter、Run/Stop Task、历史清理,与 Showcase 共用后端。
Flash 与 Pro:怎么选?
山姆「分享图存相册」用 Flash + 写清步骤的 Prompt 即可跑通;100 次批量或强校验再考虑 Pro 或拆批任务。
使用方式(Windows 实战路径)
1. 克隆与一键启动
git clone https://github.com/google/artemis.git
cd artemis
.\start.bat
脚本会拉 uv、同步依赖、可选装 ADB/scrcpy、初始化 .env,并打开 http://localhost:8000。
手动启动:
cd E:\projects\artemis
uv sync
uv run python -m artemis ui --port 8000 --open
2. 手机准备(以红米为例)
- 设置 → 我的设备 → 全部参数 → 连点 HyperOS 版本 7 次
- 更多设置 → 开发者选项 → USB 调试(建议开 USB 安装)
- 数据线连接,授权调试;adb devices 为 device
3. 配置模型与 Key
- Gemini:Setup 选 Google Gemini,填 GEMINI_API_KEY(AI Studio 免费 Key 即可)
- OpenRouter(本文做法):Setup 选 Custom Configuration,.env 填 OPEN_ROUTER_API_KEY;改 config/artemis.jsonc 的 default,例如:
"default": {
"provider": "openrouter",
"model": "deepseek/deepseek-v4.1-flash",
"fallback": {
"provider": "openrouter",
"model": "deepseek/deepseek-v4-flash-vision-exp"
}
}
控机需要 支持图像输入 的模型;纯文本 DeepSeek 不能代替。
纯 OpenRouter 时建议 agent.flash.step_summarizer.enabled: false,否则后台摘要可能仍要求 Gemini Key。
4. 下发任务
在 Launch Autonomous Task 输入目标,选 Flash,Run Task。
进 Workspace 看执行;完成后可在 Past Runs 看 COMPLETED/FAILED。
CLI 等价:
uv run artemis run "打开设置,查看电池电量" --profile flash
5. MCP 接入 Cursor(可选)
uv run artemis mcp --install cursor
IDE 内用 MCP 工具驱真机、拉 Logcat、看 Trace,适合 开发 + 测 App 一体。
案例:山姆会员商店自动生成分享图
App:山姆会员商店(中国),包名 cn.samsclub.app(勿与美国 com.rfi.sams.android 混淆)。
经验:
- Prompt 写清 页面状态(详情页顶部、别滑到评论)、误触恢复(大图预览按返回)
- 第一次常在「分享图标」上 点多轮;Helper 未装 + 浮动图标时属正常,细化 Prompt 后仍可 COMPLETED
- 一次成功会话 Token 约 16 万(/api/sessions/{id}/usage);粗算 100 次类似流程约 千万级 Token,OpenRouter 费用约 数美元~十美元量级(视模型与失败次数而定)
Prompt 模板(可改商品/App 文案):
目标 App:山姆会员商店(包名 cn.samsclub.app)。
进入任意商品详情页(保持顶部,不滑到评论区)。
点顶部导航栏右侧「分享」图标(方框+箭头,非轮播/大图)。
在分享面板点「一键生成图片」,生成后保存到相册;权限点允许。
误进全屏看图则返回再继续。
常见问题(踩坑摘要)
关掉服务:结束 uv run python -m artemis ui 进程或终端 Ctrl+C;拔 USB 即断开设备。
小结
Artemis 把 多模态 LLM + ADB +(可选)MCP 收成一套 可本地运行的移动 Agent 平台:Web 负责 Setup 与任务,Workspace 负责可解释执行,Admin/API 负责集成与计量。
若你已在用 Cursor 做客户端开发,Artemis 很适合作为 「真机自动化层」:Flash 验证想法,Pro/MCP 接进 CI 或 IDE 工作流。
参考链接
- 项目仓库:github.com/google/arte…
- 中文 README:github.com/google/arte…
- MCP 说明:github.com/google/arte…
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Warehouse: Google/artemis Agreement: Apache 2.0 Python 3.12+ Inline MCP
Foreword
When you do a mobile end test or repeat operation, the common path is to write the Appium / UIAutomator script: maintenance costs are high and the interface is hung as soon as you change.
Artemis is the Google open source of Android autonomous movement Agent: You describe the target in a natural language, the system clicks, slides, enters on a real machine or simulator, and replays every step of reasoning and cut-off on the Web console.
I picked up red rice K80 on Windows, using the OpenRouter + DeepSeek visual model, to complete the whole process of "Into Commodity Sharing to Generate Photo Albums" in the Sam Member Shop App. This paper presents the positioning, structure, interface and use of the project in conjunction with an official competency statement and a real run-through experience.
What's Artemis? Solve what?
One sentence: let AI operate the phone like a test engineer.
The official announcement on the AndroidWorld benchmark (see README) of 99% + mission completion rate is suitable for exploring AI driven UI testing, duplicate business stream automation, Bug recurrence etc.
Overall structure (from browser to mobile)
┌─────────────────────────────────────────────────────────────┐
│ Showcase UI (Angular) http://localhost:8000 │
│ Setup Wizard · Mission under W Workspace
└───────────────────────────┬─────────────────────────────────┘
│ REST / SSE
┌───────────────────────────▼─────────────────────────────────┐
│ Admin Console (FastAPI) · /docs OpenAPI │
• Task queue • Sessions/steps/use • Flow of equipment • Diagnosis
└───────────────────────────┬─────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
FlashRunner Pro LangGraph MCP Server
(observation-think-action) Planner/ Operator/ (IDE modile * tool)
Checker/Explorer...
└───────────────────┬───────────────────┘
▼
UnifiedMobileController + ADB
▼
Android real/ simulator
Dependency chain (local):
- Python 3.12+, recommended uv administration.venv and dependence (uv sync / uv run)
- ADB: Device connection and debugging
- scrcpy + FFmpeg (optional): projection and recording back Fire!
- Multi-modular LLM:Gemini / Open AI / Claude / OpenRouter, in config/artemis.jsinc +.env
Device side:
- Priority Accessibility Helper (Stable Element Tree); rollback UI Automator2 (USB installation/safe debugging for millimetres etc.)
What pages do you see when it starts?
1. Home page http://localhost:8000
- System Setup & Prequisites: Python, ADB, API Key, Device Connection, Modeling (Gemini Wizard or Custom + Artemis.jsoc)
- Launch Autonomous Task: Enter tasks, select Flash / Pro, Run Task
- Examples of Recommened Tasks: Maps, Gmail, REDnote, etc., can be filled with Prompt
The yellow bar Prequisites incomplete indicates that there is a lack of Key, no equipment or device lock, etc., and that Setup Guide is being repaired item by item.
2. Workspace /workspace
Mission Run and Reset Fields:
- Left: step-by-step reasoning (Work, Tapping Element, coordinates/index), Token context size
- Right: Task Queue
- Top: Architecture: Flash, Record State, Step Replay
Suits to see why Agent is biased and how he returns to retry.
3. API documentation http://localhost:80000/docs
Artemis Admin & Trace Console: OpenAPI 3.1, consisting of sessions, steps, usage, equipment flow, pictures/video Trace, etc., to facilitate secondary integration or check single sessions Token (GET /api/sessions/{id}/usage).
4. Admin Debug http://localhost:8000/admin
Offset: Session List, Filter, Run/Stop Task, History Cleaning, shared backend with Showcase.
Flash and Pro: How?
Sam "Shared Image Album" runs through a Prompt that writes steps in Flash +; 100 batches or hard check before considering Pro or batching.
Usage method (Windows field path)
1. Cloning and single-key startup
git clone https://github.com/google/artemis.git
cd artemis
.\start.bat
Scripts will pull uv, synchronous dependencies, optional ADB/scrcpy, initialize.env and open http://localhost:8000.
Manually:
cd E:\projects\artemis
uv sync
uv run python -m artemis ui --port 8000 --open
Cellular preparation (for example, red rice)
- Setup My Device Zoom All Parameters Zoom Connect Point HyperOS Version 7 times
- More Settings → Developer Options → USB debug (recommended to open USB installation)
- Data line connection, authorized debugging;adb devices as device
3. Configure models and Key
- Gemini: Setup choose Google Gemini to fill in GEMINI API KEY (AI Studio free of charge Key)
- OpenRouter (Practice): Setup chooses Custodial Construction,.env to add OPEN ROUTER API KEY; change to config/artemis.jsonic for example:
"default": {
"provider": "openrouter",
"model": "deepseek/deepseek-v4.1-flash",
"fallback": {
"provider": "openrouter",
"model": "deepseek/deepseek-v4-flash-vision-exp"
}
}
The controller needs to support the image input model; pure text DeepSeek cannot replace it.
summary might still require Gemini Key.
4. Assignments
Enter target in Launch Autonomous Task, select Flash, Run Task.
Go into Workspace to see execution; see COMPLED/FAILED after completion in Past Runs.
CLI Equivalent:
uv run artemis run "Open Settings, View Battery Volume" --profile flash
5. MCP Access Cursor (optional)
uv run artemis mcp --install cursor
The IDE internal MCP tool is used to purge machines, pull Logcat, look at Trace, for the development of + App.
Case: Sam member store automatically generates sharing Figure
App: Sam Member Shop (China), bag name cn.samsclub.app (do not confuse com.rfi.sams.android).
Experience:
-Prompt clears the page status (detail top, do not slip to comment), error recovery (big chart preview by return)
- for the first time often on a "Sharing Icon" multi-wheel; Helper is normal without a floating icon, fine enough for COMPLETED
- One successful session Token approximately 160,000 (/api/sessions/{id}/usage); a rough calculation of about 100 similar processes of about 1,000,000 token, OpenRouter costs about US$ ~ 10 (depending on the number of models and failures)
Prompt template (modifiable commodity/ App file):
Target: App: Sam Member Shop (pack name cn.samsclub.app).
Enter any commodity details page (maintain top and do not slide to comment area).
The "Sharing" icon on the right side of the dot-top navigation bar (box + arrow, non-rotation/big picture).
Generate a picture at the shared panel point and save it to the album after generation; permission points allow.
The error in the full screen view returns and continues.
Common problems (plug summary)
Turns off the service: Ends uv run python-m artemis ui process or terminal Ctrl+C; pull-up USB is disconnection.
Summary
Artemis uses the multi-modular LLM + ADB + (optional) MCP to produce a locally run mobile Agent platform: Web is responsible for Setup and tasks, Worldspace is responsible for interpretable execution, Admin/API is responsible for integration and measurement.
If you're already using Cursor for client development, Artemis is well suited as the "real machine automation layer": Flash validates ideas, Pro/MCP feeds into CI or IDE Z52Z.
References
- Project warehouse: Github.com/google/arte...
- README: Github.com/google/arte...
- MCP Note: Github.com/google/arte...
Auto-fetched and translated by AI Atlas. All rights belong to the original author.