artemis

命令行工具

google/artemis

将自然语言指令转化为可靠安卓自动化的 AI 智能体。

项目简介

ARTEMIS 是一个 AI 智能体,可将自然语言指令转化为可靠的安卓端到端自动化流程,采用多模态元素定位与视觉兜底。通过原生 MCP 服务器与 AI 编程助手无缝集成,可操控真实设备、采集日志与截图,在 AndroidWorld 基准上达成 99% 以上任务完成率。

README 预览

\n  \n\n\n\n  Let AI assistants and test suites use real phones like a human.\n\n\n\n  English •\n  中文文档 •\n  Workflow Showcase •\n  Quick Start •\n  MCP for IDEs •\n  Benchmarks •\n  Discord Community\n\n\n\n  \n  \n  \n  \n  \n\n\n\n\n  \n  \n  Live Demo: Setup driving routes and calculate total durations in Google Maps, then open YouTube to play a Coldplay song.\n\n\n## Key Highlights\n\n* **Cross-App Automation**: Executes testing workflows and everyday tasks on Android from natural language instructions.\n* **Multimodal Targeting**: Uses element indices when available, with coordinate and visual locating fallbacks for custom interfaces.\n* **IDE Diagnostics**: **Model Context Protocol (MCP)** integration lets **Antigravity, Claude Code, and Windsurf** drive test devices and collect **Logcat** output and screenshots.\n* **Flash Execution**: A reactive observe-and-act loop with asynchronous history summaries, typically **3–5s per step**.\n* **Pro Exploration**: Checks targets before individual actions and returns blocked actions to the Operator for recovery. Supports long-running exploratory and stability tests.\n* **AndroidWorld Results**: **99%+ task completion** on Google Research's **AndroidWorld** benchmark (100+ multi-step tasks).\n\n\n## Antigravity × ARTEMIS: Autonomous Testing Workflow\n\n**Antigravity** uses **ARTEMIS** through MCP to turn a test request into a plan, device execution, and a diagnostic report:\n\n\n  \n    \n      1. Prompt Input (Task Dispatch)\n      Describe your test scenario and target metrics in Antigravity\n      \n    \n    \n      2. Test Plan Generation\n      Formulates a step-by-step test plan & architecture for review\n      \n    \n  \n  \n    \n      3. Autonomous Test Execution\n      Drives real device, navigates UI, and profiles performance\n      \n    \n    \n      4. Final Report\n      Delivers structured audit findings, metric tables, and raw datasets\n      \n    \n  \n\n\n\n## Quick Start\n\nEnsure an Android dev

常见问题 (3)

故障排除
为什么 ./start.sh 在设置 Google Artemis 时会在 'uv sync' 步骤失败,该如何解决?

该故障的原因是仓库中的 uv.lock 错误地指向了 Google 内部的 Artifact Registry 代理(airlock-proxy.uplink.goog),该地址在 Google 网络之外无法访问,因此 uv sync 无法下载依赖项,导致 .venv/ 一直为空。解决方法:在运行安装脚本之前删除锁文件,让 uv 从 PyPI 解析依赖项:

rm uv.lock
./start.sh

维护者随后已在上游修复了 uv.lock 文件,因此拉取仓库的最新版本也可以解决该问题。

来源 Issue #28
故障排除
如何修复在 Windows 11 的 PowerShell 中运行 start.bat 时出现的 'Unexpected token' ParserError?

更新到最新的 main 分支(已在提交 38a2de6 中修复),然后再次运行 start.bat。该错误并非 Node.js 检测问题——它发生在 PowerShell 解析 scripts/start.ps1 时。Windows PowerShell 5.1 使用系统 ANSI 代码页 (cp1252) 读取无 BOM 的脚本,因此脚本中的一个 UTF-8 符号被错误解码为引号分隔符,从而导致一连串的 Unexpected token 和 The output stream for this command is already redirected 错误。该修复将两个 Windows 引导脚本的状态标签转换为仅使用 ASCII 字符,并添加了回归测试以确保它们始终保持纯 ASCII。在你的 artemis 文件夹中运行 git pull,然后再次执行 start.bat。

来源 Issue #15
故障排除
为什么在使用 OpenAI 兼容的提供商时,Artemis Flash 配置文件会失败并报 "ChatGoogleGenerativeAI missing Google credentials" 错误?

这是一个已知 bug:即使使用非 Google 的默认模型(例如通过 openai provider 使用 MiniMax-M3),Flash profile 内部的多个组件也硬编码了 Gemini 客户端,当缺少 Google 凭据时会在启动时失败。解决方法:

1. 快速修复:设置一个 Google/Gemini API 密钥(GOOGLE_API_KEY),使硬编码的客户端能够初始化,即使它们实际上不会被使用。

2. 修补硬编码路径(已经报告者验证):
- artemis/agents/flash/summarizer.py:VisualStepSummarizer 直接调用 get_google_llm() —— 将其改为使用配置中的 summarizer 模型节点及其回退节点。
- artemis/memory/chunking.py:StepCapsuleLens 为主模型和回退模型调用 get_google_llm() —— 改为通过配置的节点进行路由。
- artemis/agents/flash/runner.py:_init_llm() 在初始化出错时会静默回退到一个硬编码的 Gemini 模型 —— 移除此回退逻辑,以便暴露真正的配置错误。
- artemis/config/llm.py:显式地将 validator_pixel_safety_net 和 planner_validation 节点配置为你的 provider,否则它们会默认使用一个轻量级 Gemini 模型。

3. 或者,如果你的部署环境允许,可以禁用 Flash 的步骤摘要器和历史压缩功能。

注意:截至最新的评论,该问题在上游仍未解决,因此需要在本地打补丁。

来源 Issue #179