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: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "android-use",
"displayName": "Android Use",
"version": "0.7.1",
"version": "0.8.0",
"description": "通过 ADB 和 UiAutomator2 操作 Android,支持控件树、截图、中文输入、批处理和浏览器实时屏幕。",
"author": {
"name": "arcships",
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "android-use",
"version": "0.7.1",
"version": "0.8.0",
"description": "通过 ADB 和 UiAutomator2 操作 Android,支持实时屏幕侧边栏、控件树、截图、中文输入和批处理。",
"skills": "./skills/",
"mcpServers": "./.mcp.json",
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="#mcp-client-support"><img src="https://img.shields.io/badge/MCP-stdio-3DDC84" alt="Standard stdio MCP" /></a>
</p>
<p><strong>English</strong> · <a href="README.zh-CN.md">简体中文</a></p>
<p><a href="#quick-start"><strong>Use in Dim Agent →</strong></a> · <a href="https://github.com/arcships/android-use/releases/tag/v0.7.1">Download v0.7.1</a> · <a href="#enable-jev-from-the-screen">Set up Jev</a> · <a href="docs/guide.md">User guide</a> · <a href="https://github.com/arcships/android-use/issues">Report an issue</a></p>
<p><a href="#quick-start"><strong>Use in Dim Agent →</strong></a> · <a href="https://github.com/arcships/android-use/releases/tag/v0.8.0">Download v0.8.0</a> · <a href="#enable-jev-from-the-screen">Set up Jev</a> · <a href="docs/guide.md">User guide</a> · <a href="https://github.com/arcships/android-use/issues">Report an issue</a></p>
</div>

## Android tasks, inside Dim Agent
Expand Down Expand Up @@ -162,6 +162,10 @@ Enabling Jev sends the subgoal, visible UI text and supplied input values to Typ
| **Input with verification** | Unicode/emoji, replace/append and native text readback. A stable field can offer one focus → input → readback decision. |
| **Keep control clear** | User takeover for authentication, partial/uncertain action ledgers and no automatic replay. |

## Edit code, see it on the phone · v0.8.0

When the agent is developing an Android app from local source, `aua_hot_swap` pushes each edit into the running debuggable app in about a second. Classes are redefined in place and resources reloaded, so the app is not reinstalled or restarted: Compose keeps its remembered state, View screens keep scroll position and typed text, and the live screen shows the result. Gradle projects need no setup; anything that cannot be swapped falls back to a full build. [Hot swap →](docs/hot-swap.md)

## Other clients and manual setup

### Let your agent install it
Expand Down Expand Up @@ -327,7 +331,7 @@ Development comparisons include **18 source-level trials** and **12 live Agent /

## Project status

**v0.7.1 · MIT · 487 Python tests · 25 browser tests.** Native install/upgrade/rollback acceptance was last run for v0.7.0 and passed on macOS ARM64/Intel (15 scenarios each), Linux x86_64 and Windows x86_64 (13 each). These package checks use no phone or model; earlier Android 16 physical-device and emulator acceptance remain separate. [Validation evidence →](docs/validation.md)
**v0.8.0 · MIT · 497 Python tests · 25 browser tests.** Native install/upgrade/rollback acceptance was last run for v0.7.0 and passed on macOS ARM64/Intel (15 scenarios each), Linux x86_64 and Windows x86_64 (13 each). These package checks use no phone or model; earlier Android 16 physical-device and emulator acceptance remain separate. [Validation evidence →](docs/validation.md)

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.

Expand Down
8 changes: 6 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="#mcp-客户端支持"><img src="https://img.shields.io/badge/MCP-stdio-3DDC84" alt="标准 stdio MCP" /></a>
</p>
<p><a href="README.md">English</a> · <strong>简体中文</strong></p>
<p><a href="#快速开始"><strong>在 Dim Agent 中使用 →</strong></a> · <a href="https://github.com/arcships/android-use/releases/tag/v0.7.1">下载 v0.7.1</a> · <a href="#在屏幕中启用-jev">配置 Jev</a> · <a href="docs/guide.zh-CN.md">使用指南</a> · <a href="https://github.com/arcships/android-use/issues">反馈问题</a></p>
<p><a href="#快速开始"><strong>在 Dim Agent 中使用 →</strong></a> · <a href="https://github.com/arcships/android-use/releases/tag/v0.8.0">下载 v0.8.0</a> · <a href="#在屏幕中启用-jev">配置 Jev</a> · <a href="docs/guide.zh-CN.md">使用指南</a> · <a href="https://github.com/arcships/android-use/issues">反馈问题</a></p>
</div>

## 在 Dim Agent 中,直接完成 Android 任务
Expand Down Expand Up @@ -159,6 +159,10 @@ Dim Agent 会调用 Android 工具,通过 `aua_screen` 在桌面端右侧打
| **输入与核对** | 中文、emoji、替换/追加和原生回读;稳定输入框可一次决策完成聚焦→输入→回读。 |
| **清楚交接控制** | 认证由用户接管;保留 partial/uncertain 动作账本,不自动重放。 |

## 改完代码,手机上立刻看到 · v0.8.0

Agent 在本机开发 Android App 时,`aua_hot_swap` 约一秒内把改动送进运行中的可调试 App:类在进程内重定义,资源重新加载,不重装、不重启。Compose 保留 remember 状态,View 页面保留滚动位置和已输入的文字,实时屏幕里直接看到结果。Gradle 工程无需配置;不能热更新的改动自动退回完整构建。[说明](docs/hot-swap.md)

## 其他客户端与手动安装

### 让 Agent 自己安装
Expand Down Expand Up @@ -325,7 +329,7 @@ v0.5.0 通过 **277 项 Python 测试、17 项界面测试**。内置 OCR 目前

## 项目状态

**v0.7.1 · MIT · 487 项 Python 测试 · 25 项浏览器测试。** 原生安装、升级和回滚验收最近一次针对 v0.7.0 执行,在 macOS ARM64/Intel 各通过 15 项,Linux x86_64/Windows x86_64 各通过 13 项。这些包验收不操作手机、不调用模型;历史 Android 16 真机与模拟器验收分开记录。[验证记录](docs/validation.md)。
**v0.8.0 · MIT · 497 项 Python 测试 · 25 项浏览器测试。** 原生安装、升级和回滚验收最近一次针对 v0.7.0 执行,在 macOS ARM64/Intel 各通过 15 项,Linux x86_64/Windows x86_64 各通过 13 项。这些包验收不操作手机、不调用模型;历史 Android 16 真机与模拟器验收分开记录。[验证记录](docs/validation.md)。

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

Expand Down
7 changes: 4 additions & 3 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ Choose a release ZIP or a source checkout. If you already use `android-use-local

### Install the release ZIP

Download `android-use-0.7.1-plugin.zip` and `SHA256SUMS` from [GitHub Release v0.7.1](https://github.com/arcships/android-use/releases/tag/v0.7.1). The ZIP includes the compiled UI, Python source/lockfile, stable installer, skills, bilingual docs and a local marketplace. Prepare uv, ADB, ffmpeg and the Codex CLI; dependencies are downloaded on first installation.
Download `android-use-0.8.0-plugin.zip` and `SHA256SUMS` from [GitHub Release v0.8.0](https://github.com/arcships/android-use/releases/tag/v0.8.0). The ZIP includes the compiled UI, Python source/lockfile, stable installer, skills, bilingual docs and a local marketplace. Prepare uv, ADB, ffmpeg and the Codex CLI; dependencies are downloaded on first installation.

```bash
shasum -a 256 -c SHA256SUMS # Linux: sha256sum -c SHA256SUMS
unzip android-use-0.7.1-plugin.zip -d android-use-v0.7.1
cd android-use-v0.7.1
unzip android-use-0.8.0-plugin.zip -d android-use-v0.8.0
cd android-use-v0.8.0
uv run --no-project --python 3.13 python scripts/install.py doctor
uv run --no-project --python 3.13 python scripts/install.py install --source . --codex
```
Expand Down Expand Up @@ -414,6 +414,7 @@ uv run android-use tools
| `aua_scroll_until` | Bounded visible-target search without clicking. |
| `aua_apps / aua_launch_app / aua_press_button` | Package IDs, app launch, system buttons. |
| `aua_batch` | Bounded serial batches. |
| `aua_hot_swap` | Apply source edits to the running debuggable app without reinstalling. [Hot swap →](hot-swap.md) |
| `aua_pause / aua_resume` | User authentication handoff. |
| `aua_screen` | Open/reuse live preview. |
| `aua_screen_frame / aua_screen_action` | App-only cached video/UI interfaces; not agent refresh tools. |
Expand Down
7 changes: 4 additions & 3 deletions docs/guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ uv run android-use --serial SERIAL ready

### 安装发行包 ZIP

从 [GitHub Release v0.7.1](https://github.com/arcships/android-use/releases/tag/v0.7.1) 下载 `android-use-0.7.1-plugin.zip` 和 `SHA256SUMS`。包内包含编译好的界面、源码与锁文件、固定入口安装器、技能和双语说明;先准备 uv、ADB、ffmpeg 和 Codex CLI,首次安装需下载 Python 依赖。
从 [GitHub Release v0.8.0](https://github.com/arcships/android-use/releases/tag/v0.8.0) 下载 `android-use-0.8.0-plugin.zip` 和 `SHA256SUMS`。包内包含编译好的界面、源码与锁文件、固定入口安装器、技能和双语说明;先准备 uv、ADB、ffmpeg 和 Codex CLI,首次安装需下载 Python 依赖。

```bash
shasum -a 256 -c SHA256SUMS # Linux: sha256sum -c SHA256SUMS
unzip android-use-0.7.1-plugin.zip -d android-use-v0.7.1
cd android-use-v0.7.1
unzip android-use-0.8.0-plugin.zip -d android-use-v0.8.0
cd android-use-v0.8.0
uv run --no-project --python 3.13 python scripts/install.py doctor
uv run --no-project --python 3.13 python scripts/install.py install --source . --codex
```
Expand Down Expand Up @@ -405,6 +405,7 @@ MCP 工具以 `aua_` 为前缀:
| `aua_scroll_until` | 有界滚动查找可见目标,不自动点击 |
| `aua_apps / aua_launch_app / aua_press_button` | 包名查询、启动与系统按钮 |
| `aua_batch` | 有界批处理 |
| `aua_hot_swap` | 把源码改动热更新到运行中的可调试 App,不重装、不重启。[说明](hot-swap.md) |
| `aua_pause / aua_resume` | 用户认证接管 |
| `aua_screen` | 打开 / 复用实时屏幕侧边栏 |
| `aua_screen_frame / aua_screen_action` | App 专属视频缓存和工具栏接口,供 UI 使用 |
Expand Down
50 changes: 50 additions & 0 deletions docs/hot-swap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Hot swap: apply source edits to the running app

`aua_hot_swap` is for developing an Android app whose source is on the same computer. After an edit, one call compiles what changed and redefines the classes inside the running process. The app is not reinstalled or restarted, so the screen the agent was looking at stays where it was. With the live screen open, the change shows up there about a second later.

It uses the JDK and the Android SDK directly (javac, the Kotlin compiler, D8, aapt2, a small JVMTI agent). There is no Gradle plugin and nothing is added to the app's build.

## Use

```bash
# What would happen, and is the host ready? Changes nothing.
uv run android-use hot_swap '{"project":"/path/to/MyApp","action":"status"}'

# After each edit. The first call does the full build, install and launch.
uv run android-use hot_swap '{"project":"/path/to/MyApp","observe":"screenshot"}'
```

| Argument | Meaning |
| --- | --- |
| `project` | Absolute path of a Gradle root, of a module directory below it, or of a directory with a `hotswap.json`. |
| `action` | `swap` (default), `build` (force the full build, install and launch) or `status`. |
| `refresh` | `auto` (default), `recreate` (rebuild every activity) or `none` (leave the UI alone). |
| `module`, `variant` | Gradle only; default `:app` and `Debug`. Remembered in `build/hotswap-config.json`; changing one forces a full build. |
| `observe` | `none` (default), `tree`, `screenshot` or `both`: return the screen after the swap in the same call. |

The result is one of:

- `swapped`: classes and/or resources were replaced in place. `applied` says how many classes were redefined or added, whether Compose recomposed and whether an activity was rebuilt.
- `installed`: a full build ran instead; `reason` says why (first call, the app was not running, a manifest or build file changed, a source file was deleted, the runtime refused the swap).
- `unchanged`: nothing differs from what the process runs.

A compile error returns `compile_failed` with the compiler output and leaves the app as it was. Fix the source and call again. `verified` is always `false`: the tool reports what was loaded, the agent checks the UI.

## What is kept

- Compose: the functions run again over their existing state. `remember` values and scroll positions stay. A structural change to a composable (calls added or removed) resets that function's state only.
- Views: the activity is rebuilt with its saved state, plus scroll offsets, the text of input fields without an ID, and the keyboard. Instance fields of the activity are not kept.
- The process: statics, singletons, the back stack, the login session.

## Requirements and limits

- The app must be debuggable (`android:debuggable="true"`, the default for debug builds) and the device must run Android 8 or later. Resource edits need Android 11 or later.
- Host: a JDK on `PATH`, the Android SDK (`ANDROID_HOME`, or the default location) with build-tools and a platform. The NDK is needed once per device ABI to compile the agent; the result is cached under the Android Use state directory. macOS and Linux.
- Gradle projects are detected from `settings.gradle(.kts)`. Gradle does the full builds; the swaps reuse the classpath and compiler flags it exports. Settings and caches go to the project's `build/` directory.
- A plain project describes itself in `hotswap.json`; see `script/hotswap/app/hotswap.json`.
- Not yet covered: annotation processors (kapt, KSP, Hilt, Room) that must rerun for an edit, edits spanning several Gradle modules, Kotlin 2.x. Those edits still work through the full-build fallback when the swap is refused, but an edit that needs regenerated code should use `action=build`.
- Paused devices (authentication handoff) refuse `swap` and `build`.

## Check it on a device

`script/hotswap/verify.py [-s SERIAL] [--gradle]` builds the lab apps in `script/hotswap/`, edits their sources and confirms from the app's own log what the running process executes: method bodies, new methods, fields and classes, lambdas, Kotlin inline functions, resource values, colours and new resources, and that typed text, scroll offsets and Compose state survive.
Loading
Loading