Skip to main content Switch to mobile version phone-pilot 0.14.0 Multi-platform mobile automation via MCP - Control Android devices through AI agents
pip install phone-pilot==0.14.0 Copy PIP instructions
版本:0.14.0 | Python:>= 3.13 | 协议:MCP (stdio) + Python script_api | 许可:MIT
phone_pilot(简称 pp)是一套面向研发与发版验收闭环的跨平台(Android / HarmonyOS / iOS)AI 原生移动自动化与极速审片基础设施。它让 AI Agent 与测试脚本在同一套零业务硬编码底座上完成:编译新鲜度阻断 ➔ 多模态感知与操作 ➔ 本地双端口网络打桩 ➔ 三证合一人眼极速审片 ➔ 受控真机现场复原。
# 核心安装(默认含 Android / OpenCV Headless / Jinja2 报告引擎) pip install phone-pilot # 按需安装平台与扩展能力 pip install "phone-pilot[harmony]" # HarmonyOS (hmdriver2 + HDC) pip install "phone-pilot[ios]" # iOS (WebDriverAgent + pymobiledevice3, 仅 macOS) pip install "phone-pilot[restore]" # Android 现场复原 APK Manifest 静态校验 (androguard) pip install "phone-pilot[vision]" # 多语种检测与翻译扩展 pip install -e ".[dev]" # 本地源码开发模式 # 检查本机 ADB / Tesseract / OpenCV 可选依赖就绪状态 python scripts/check_verification_env.py 2. 在 MCP 客户端(Cursor / Claude / Antigravity)中挂载
{ "mcpServers": { "phone_pilot": { "command": "phone-pilot-mcp", "args": [], "env": { "PHONE_PILOT_PLATFORM": "auto" } } } } 3. 四大命令行入口(CLI)
# 1. 启动 MCP stdio 服务端 phone-pilot-mcp # 2. 命令行直调任意 MCP 工具或自省公开 API phone-pilot-call --list-tools phone-pilot-call --list-script-api phone-pilot-call phone_get_page_state --args '{"annotate_elements": true}' # 3. 启动本地可视化验收工作台(默认 http://127.0.0.1:8686) # 注:默认开启本地有效 run 的复原审批,共享/严格环境请显式传 --no-auto-approve phone-pilot-web --port 8686 # 4. 命令行只读预检或受控执行设备语义现场复原(非录像回放) phone-pilot-restore .recordings/runs/ phone-pilot-restore .recordings/runs/ --device-serial --approve-manifest-sha256 4. 最小 Python 业务验收脚本示例(script_api)
from phone_pilot.script_api import ScriptContext, find_text, run_script, tap_when_ready ctx = ScriptContext(platform="auto", auto_screenshot=True, popup_guard=True) def main() -> int: ctx.declare_cases([{ "case_id": "TC-01", "steps": [{ "business_step_id": "open_target", "title": "进入目标业务页", "expected": "目标控件可见", "required_dimensions": ["ui"], "not_applicable": {"callback_log": "纯UI示例", "network": "无网络断言"}, "required_evidence": ["screenshot"], }], }]) with ctx.business_step("TC-01", "open_target", action="点击入口按钮", environment_ref="local-dev") as step: res = tap_when_ready(ctx, text="开始体验", timeout_s=10) ev = step.capture("target_screen") ok = bool(res.get("ok") and find_text(ctx, "目标标题", retry_attempts=2)) step.add_assertion("ui", "PASS" if ok else "FAIL", "目标标题可见", f"ok={ok}", evidence_refs=[ev["evidence_id"]]) step.actual = f"ok={ok}" return 0 if __name__ == "__main__": run_script(main, ctx=ctx) 三、平台成熟度摘要
详细逐项能力请查阅全仓唯一权威矩阵 FEATURE_MATRIX.md:
全量产品与技术知识中心(外部 /phone_pilot/,由 $AGENT_DOC_ROOT 指定): 全景索引与进度看板: /phone_pilot/00-index/INDEX.md
新项目 15 分钟零侵入接入与双 Profile 契约(pp_profile.v2 / acceptance_profile.v1): /phone_pilot/01-knowledge/integration-and-profiles-spec.md
v4.0 极速人眼审片工作台与受控现场复原边界手册: /phone_pilot/01-knowledge/human-acceptance-and-restore-guide.md
六层架构与 L1 零业务耦合宪章: /phone_pilot/01-knowledge/product-and-architecture-overview.md
四维质量打分、新鲜度门禁与排障手册: /phone_pilot/01-knowledge/quality-scoring-and-triage-spec.md
多 Agent 并发设备租约锁与录制转脚本规范: /phone_pilot/01-knowledge/agent-concurrency-and-authoring.md
四大 CLI / 95 项 MCP / 65 项 script_api / 环境变量全量字典: /phone_pilot/01-knowledge/reference-cli-mcp-script-api.md
make lint # ruff check . make format-check # ruff format --check . make test # pytest 全量单元与零业务耦合门禁测试 make check # lint + test Project links
dev restore harmony ios vision all
mcp android automation mobile testing ai-agent llm
Development Status 4 - Beta
Intended Audience Developers
License OSI Approved :: MIT License
Operating System OS Independent
Programming Language Python :: 3
Topic Software Development :: Quality Assurance
Software Development :: Testing
Release files for phone-pilot 0.14.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 1.7 MB
Release files / phone_pilot-0.14.0.tar.gz
Release files / phone_pilot-0.14.0-py3-none-any.whl
Security for phone-pilot 0.14.0
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 3, 2026 2 release files No provenance
Nov 30, 2026 2 release files No provenance
Nov 27, 2026 2 release files No provenance
Nov 18, 2026 2 release files No provenance
Nov 10, 2026 2 release files No provenance
Nov 2, 2026 2 release files No provenance
Oct 29, 2026 2 release files No provenance
Jul 27, 2026 2 release files No provenance
Mar 17, 2026 2 release files No provenance
Mar 16, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




