Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Preserve upstream license bytes, including original whitespace, for provenance hashes.
docs/licenses/LICENSE.* -text -whitespace
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ jobs:
tests:
uses: ./.github/workflows/test.yml

runtimes:
uses: ./.github/workflows/runtime.yml

release:
needs: tests
needs: [tests, runtimes]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -32,15 +35,22 @@ jobs:
run: |
title=$(python3 scripts/release_check.py "$GITHUB_REF_NAME")
echo "title=$title" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@v4
with:
pattern: runtime-*
path: dist/runtime
merge-multiple: true
- name: Build plugin ZIP
run: |
python3 scripts/package.py
cd dist && sha256sum "android-use-${GITHUB_REF_NAME#v}-plugin.zip" > SHA256SUMS
cd dist
sha256sum "android-use-${GITHUB_REF_NAME#v}-plugin.zip" > SHA256SUMS
cat runtime/*SHA256SUMS >> SHA256SUMS
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
TITLE: ${{ steps.check.outputs.title }}
run: |
gh release create "$GITHUB_REF_NAME" \
"dist/android-use-${GITHUB_REF_NAME#v}-plugin.zip" dist/SHA256SUMS \
"dist/android-use-${GITHUB_REF_NAME#v}-plugin.zip" dist/runtime/*.zip dist/SHA256SUMS \
--verify-tag --title "$TITLE" --notes-file "docs/releases/$GITHUB_REF_NAME.md"
102 changes: 102 additions & 0 deletions .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Standalone runtimes

on:
workflow_dispatch:
workflow_call:
pull_request:
paths:
- 'src/android_use/**'
- 'pyproject.toml'
- 'uv.lock'
- 'scripts/*runtime*'
- 'scripts/frozen_entry.py'
- '.github/workflows/runtime.yml'
- 'docs/licenses/**'
- 'docs/third-party-introduction.md'
- 'ui/build.mjs'
- 'tests/fixtures/runtime-sample.h264'
- 'THIRD_PARTY_NOTICES.md'
- 'LICENSE'
- '.gitattributes'

permissions:
contents: read

concurrency:
group: standalone-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
inputs:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: '3.13.7'
- run: uv run --frozen python scripts/fetch_runtime_inputs.py --cache dist/runtime-inputs
- uses: actions/upload-artifact@v4
with:
name: standalone-build-inputs
path: dist/runtime-inputs/*
retention-days: 7
build:
needs: inputs
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
platform: linux-x86_64
- os: macos-15
platform: macos-arm64
- os: macos-15-intel
platform: macos-x86_64
- os: windows-2022
platform: windows-x86_64
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
id: build-python
with:
python-version: '3.13.7'
- uses: astral-sh/setup-uv@v6
- name: Prepare Windows compiler
id: msys2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: make mingw-w64-x86_64-gcc diffutils pkgconf
- name: Expose Windows compiler
if: runner.os == 'Windows'
shell: pwsh
run: |
$msys = '${{ steps.msys2.outputs.msys2-location }}'
(Join-Path $msys 'mingw64/bin') >> $env:GITHUB_PATH
(Join-Path $msys 'usr/bin') >> $env:GITHUB_PATH
"ANDROID_USE_BUILD_BASH=$(Join-Path $msys 'usr/bin/bash.exe')" >> $env:GITHUB_ENV
- uses: actions/download-artifact@v4
with:
name: standalone-build-inputs
path: dist/runtime-build
- run: uv sync --frozen --python "${{ steps.build-python.outputs.python-path }}"
- run: uv pip install -r scripts/runtime-build-requirements.txt
- name: Build native runtime and Dim plugin
run: uv run --no-sync python scripts/build_runtime.py
- name: Build a distinct upgrade version in a disposable source tree
run: uv run --no-sync python scripts/build_runtime_upgrade_fixture.py
- name: Test install, upgrade, rollback and bundled tools
run: uv run --no-sync python scripts/accept_runtime.py --archive dist/runtime/android-use-runtime-${{ matrix.platform }}.zip --upgrade-archive dist/runtime-upgrade/android-use-runtime-${{ matrix.platform }}.zip
- uses: actions/upload-artifact@v4
with:
name: runtime-${{ matrix.platform }}
path: |
dist/runtime/*.zip
dist/runtime/*SHA256SUMS
dist/runtime/acceptance.json
retention-days: 14
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 JackCaow
Copyright (c) 2026 Archship

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ For workflows that need repeated UI decisions, enable **Jev**. Your Agent keeps

**No root, Appium, signing setup, or keyboard APK.** The compiled UI is included. Use USB or already-authorized wireless ADB.

## Choose an installation path

**The standalone runtime is optional.** The Agent inspects the environment and chooses the appropriate route; a working installation is reused.

| Environment | Installation choice |
| --- | --- |
| Existing healthy Android Use / MCP | Reuse it and verify the connection. |
| Python/uv, ADB and ffmpeg already available | Use the source installation and existing tools. |
| Dependencies missing, matching verified native assets available | Use the optional standalone runtime to avoid installing dependencies individually. |
| Offline, unsupported native target, or no native release assets yet | Use a suitable local archive or source setup; report any missing prerequisites. |

### Optional standalone runtime (new source feature)

**Python, ADB, ffmpeg, the screen UI and the control service in one native package.** The lightweight Dim plugin installs it automatically on first use. Later MCP connections start the installed version immediately and check for updates in the background; verified updates take effect on the next connection. Failed updates retain the previous version; rollback rechecks it before switching.

**macOS OCR is an optional add-on**, omitted from the default package. Tree interaction, Agent screenshot inspection and Jev can be used without it. Users choosing this package do not need Python, uv, Git, Node.js, a JDK or Xcode tools; public-release bootstrap uses standard OS utilities. Private-release bootstrap additionally supports GitHub CLI with a private token; offline native installation avoids that requirement.

This is newer than the published v0.6.2 source-plugin ZIP. Use native workflow artifacts for offline trials until a release containing the runtime assets is published. [Install, automatic updates, optional OCR and rollback →](docs/standalone.md)

## Quick start

### Use in Dim Agent
Expand All @@ -39,8 +58,11 @@ https://github.com/arcships/android-use

Read README.md, docs/guide.md and skills/android-use/SKILL.md.
Reuse existing installations and preserve other MCP servers and uncommitted work.
Check Git, uv, ADB and ffmpeg; install missing dependencies from official sources.
Use scripts/install.py install --source . to create a stable managed runtime.
Inspect Python/uv, ADB, ffmpeg, platform, network and available release assets.
Choose source installation or the optional standalone package for this environment;
do not migrate a healthy installation just to use a runtime. Read docs/standalone.md.
For source setup use scripts/install.py install --source .; for native setup verify
the matching archive SHA256. Both routes must return a stable MCP launch command.
Register its returned mcp_config as Dim's local stdio server named android_use;
use Dim's MCP management or dim mcp add. Check for duplicate registrations first.
Discover devices, select my intended phone, call aua_setup(action="status"),
Expand All @@ -54,23 +76,23 @@ and unlocking. Leave Jev disabled for now.
<details>
<summary>Manual Dim setup — stable MCP entry</summary>

Prepare the dependencies and [clone the repository](#or-install-manually), then run from its root:
Choose the source route when its dependencies are available, or the [optional standalone package](docs/standalone.md) when it better fits the environment. Both return a stable `mcp_config`. For source setup, prepare dependencies and [clone the repository](#or-install-manually), then run from its root:

```bash
uv run --no-project --python 3.13 python scripts/install.py install --source .
```

The JSON result contains `mcp_config.command` and `mcp_config.args`. In Dim's **MCP management**, add a **local stdio** server named `android_use`, using that command and the arguments in their original order. The installer creates an independent runtime and verifies its MCP handshake before switching versions.

With the Dim CLI, the equivalent is below. Replace the two quoted placeholders with the exact `command` and `args[0]` returned by the installer:
With the Dim CLI, register the returned command and **all** arguments in order. This example is the standalone macOS/Linux entry; replace the launcher path with your actual install result:

```bash
dim mcp add --scope user android_use -- \
"/absolute/path/from/mcp_config.command" \
"/absolute/path/from/mcp_config.args[0]" serve
dim mcp add --scope user android_use -- /bin/sh "/absolute/path/runtime/launcher.sh" auto-serve
dim mcp test android_use --json
```

For Windows or the source installer, use their returned `mcp_config` instead of copying these arguments. See [native package installation](docs/standalone.md#offlinemanual-native-package).

Check that the MCP test returns a non-empty tool list. Some Dim CLI versions can return `success=true` with `tools=[]`; that alone does not confirm tools are loaded. In a new Dim chat, actually call `aua_setup` and `aua_ready`. If Android Use is already registered, inspect that entry before adding another. [Upgrade and rollback →](docs/upgrading.md)

</details>
Expand Down Expand Up @@ -295,6 +317,12 @@ Development comparisons include **18 source-level trials** and **12 live Agent /

Multi-touch, arbitrary gesture paths, fine-grained text selection and custom-editor input fallbacks are not implemented. A matched UI condition proves that condition; the Agent must verify business outcomes. Control and preview run locally, and tool results are handled by your chosen client/model.

Android Use is maintained by **Archship** and its source is MIT; bundled runtime dependencies retain their own licenses. [License audit and package notices →](docs/license-audit.md)

## Acknowledgements

Thank you to [iPhone Use](https://github.com/zhongerxin/iPhone-use), its author and contributors for inspiring Android Use's phone-agent workflow, guided setup and live-screen experience.

## Explore and contribute

| Start here | Go deeper |
Expand Down
40 changes: 33 additions & 7 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ Android Use 把你自己的 Android 手机或模拟器接入 **Dim Agent**,也

**无需 root、Appium、签名配置或键盘 APK。** 已包含编译好的界面,通过 USB 或已授权的无线 ADB 连接。

## 按环境选择安装方式

**独立 runtime 不是必需项。** Agent 先检查用户环境,再自主选择合适的安装方式;已有健康安装直接复用。

| 用户环境 | 安装选择 |
| --- | --- |
| 已有正常工作的 Android Use / MCP | 复用现有入口并验证连接。 |
| 已有 Python/uv、ADB 和 ffmpeg | 使用源码安装,复用现有依赖。 |
| 缺少依赖,且有匹配、可校验的原生发行包 | 可选独立 runtime,减少逐项安装依赖。 |
| 离线、不支持的原生平台或尚无原生发行资产 | 选择可用的本地包或源码安装,明确缺失条件。 |

### 可选独立运行包(新源码功能)

**Python、ADB、ffmpeg、实时界面和控制服务,打成一个原生运行包。** 轻量 Dim 插件首次自动安装;后续 MCP 连接立即使用已安装版本,并在后台检查更新。新包校验、握手通过后,下一次连接使用新版;失败保留旧版,回滚前也会重新验证。

**macOS OCR 是可选组件,默认包不带。** 控件树操作、Agent 看图和 Jev 均可独立使用。选择独立包的用户无需准备 Python、uv、Git、Node.js、JDK 或 Xcode 工具,公开发行包首次下载只使用系统基础工具。私有发行包自动安装支持 GitHub CLI 与私有令牌,也可用原生离线包省去此依赖。

此功能晚于已发布的 v0.6.2 源码插件 ZIP。正式 Release 尚未包含这些资产时,可用原生构建工作流产物离线体验。[安装、自动更新、可选 OCR 与回滚 →](docs/standalone.md#中文)

## 快速开始

### 在 Dim Agent 中使用
Expand All @@ -39,8 +58,9 @@ https://github.com/arcships/android-use

先阅读 README.md、docs/guide.zh-CN.md 和 skills/android-use/SKILL.md。
复用已有安装,保留其他 MCP 服务和未提交改动。
检查 Git、uv、ADB、ffmpeg,从官方来源补齐依赖。
用 scripts/install.py install --source . 创建固定入口的独立运行时。
检查 Python/uv、ADB、ffmpeg、系统架构、网络与可用发行资产,自主选择源码安装或可选独立包。
不要为了使用 runtime 迁移已有健康安装,先读 docs/standalone.md。
源码方式用 scripts/install.py install --source .;独立包核对平台与发行 SHA256,均使用返回的固定入口。
把返回的 mcp_config 注册为 Dim 的本地 stdio MCP,名称 android_use;
使用 Dim 的 MCP 管理或 dim mcp add,先检查已有注册,避免重复配置。
发现设备,明确选择我的目标手机,先调用 aua_setup(action="status"),
Expand All @@ -53,23 +73,23 @@ https://github.com/arcships/android-use
<details>
<summary>手动配置 Dim:使用固定 MCP 入口</summary>

准备依赖并[克隆仓库](#或者手动安装),在仓库根目录执行:
已有依赖可使用源码方式;缺少依赖时,可按环境选择[独立运行包](docs/standalone.md#中文)。两种方式均返回固定 `mcp_config`。选择源码方式时,准备依赖并[克隆仓库](#或者手动安装),在仓库根目录执行:

```bash
uv run --no-project --python 3.13 python scripts/install.py install --source .
```

返回的 JSON 包含 `mcp_config.command` 和 `mcp_config.args`。在 Dim 的 **MCP 管理**中添加**本地 stdio** 服务,名称填 `android_use`,命令与参数按返回值逐项填写,保持参数顺序。安装器会创建独立运行时,真实 MCP 握手通过后才切换版本。

已安装 Dim CLI 时,也可使用下方命令。两处带引号的占位路径分别替换为安装器返回的 `command` 和 `args[0]`:
已安装 Dim CLI 时,将返回的命令和**全部参数**依次注册。下方示例是独立包的 macOS/Linux 入口,启动器路径按安装结果替换:

```bash
dim mcp add --scope user android_use -- \
"/absolute/path/from/mcp_config.command" \
"/absolute/path/from/mcp_config.args[0]" serve
dim mcp add --scope user android_use -- /bin/sh "/absolute/path/runtime/launcher.sh" auto-serve
dim mcp test android_use --json
```

Windows 和源码安装器请使用各自返回的 `mcp_config`,不要照抄此参数。[原生包安装 →](docs/standalone.md#offlinemanual-native-package)

检查 MCP 测试返回的工具列表是否非空;部分 Dim CLI 版本会返回 `success=true`、`tools=[]`,不能据此判断工具已加载。请在新的 Dim 聊天中实际调用 `aua_setup` 和 `aua_ready`。已有 Android Use 注册时,先检查原条目再配置。[升级与回退 →](docs/upgrading.md#中文)

</details>
Expand Down Expand Up @@ -295,6 +315,12 @@ v0.5.0 通过 **277 项 Python 测试、17 项界面测试**。内置 OCR 目前

多指手势、任意轨迹、精细文本选区及自绘编辑器输入兜底尚未实现。UI 条件满足仅证明该条件,Agent 仍需验收业务结果。控制和预览运行于本机,工具结果由你选择的客户端与模型处理。

Android Use 由 **Archship** 维护,源码采用 MIT;运行包依赖保留各自协议。[协议审计与随包声明 →](docs/license-audit.md#中文)

## 致谢

感谢 [iPhone Use](https://github.com/zhongerxin/iPhone-use) 的作者与贡献者,为 Android Use 在手机 Agent 交互、引导式安装和实时画面方面带来的启发。

## 文档与贡献

| 开始使用 | 深入了解 |
Expand Down
4 changes: 3 additions & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Third-party notices

Android Use source code is licensed under MIT. The bundled browser SDK and its dependencies retain their own licenses, reproduced below. Python dependencies and ffmpeg are installed separately and retain their upstream licenses.
Android Use source code is licensed under MIT. The bundled browser SDK and its dependencies retain their own licenses, reproduced below. Source installations obtain Python dependencies and ffmpeg separately. Standalone runtime archives include CPython, Python dependencies, Android Platform Tools and a minimal FFmpeg build; they retain their upstream licenses. Each runtime carries CPython and Python-package notices under `licenses/`, Android Platform Tools notices under `tools/adb/`, and the corresponding FFmpeg source archive plus exact configure options under `licenses/`. Native runtime inputs and SHA256 values are pinned in `scripts/runtime-inputs.json`. The optional macOS OCR component uses the system Vision framework and is distributed separately.

The standalone FFmpeg executable uses LGPL-2.1-or-later under the exact restricted build configuration. Its corresponding source, license and build options are inside the same runtime archive. Certifi's MPL-2.0 source form is included under `licenses/sources/certifi`. Original native/package notices and an inventory are included under `licenses/`; they are not replaced by this project's MIT license. See `docs/license-audit.md` for the build gate, exclusions and remaining scope.

## @modelcontextprotocol/ext-apps@1.7.5

Expand Down
Loading
Loading