boluopai.
中文 · unavailable
LibraryOriginal edition

android-control

<用户自制> 安卓控制:操作真实安卓手机,管理应用、界面、文件与连接。 Use ADB, app interfaces, and UI automation for authorized work on an identified physical Android phone; verify device identity and phone-side results.

Extend the user's reach to the phone while keeping the phone's own state in view. The host is a hand and a window: it can act at a distance, but a successful gesture on the host matters only when the intended phone responds.

The user supplies the task and its authorization; the model connects that purpose to one identified physical device and the relevant app or files. ADB transport aliases identify connections, not necessarily different phones. App hierarchies expose controls, while overlays and transitions can change what a gesture reaches. Login and permission decisions retain their actual owners. These relations make device identity, fresh observation, and phone-side readback part of the operation rather than optional diagnostics.

Complete the requested task through the current connection. Reuse established access and authorization, select ADB, app-native interfaces, or UI automation for the operation, and verify its effect on the identified phone. A terminal command is not automatically a better interface.

Connect and inspect

Bind the connection to the device before binding a gesture to a control:

  1. Run python3 <skill>/scripts/android_inspect.py devices. It reports ADB transport names and physical identities. Multiple mDNS aliases can represent one phone; compare identities before treating them as separate devices. Select an explicit current serial for subsequent commands. Resolve ambiguity from task context or the user before a mutation on an unidentified phone.
  2. For UI work, use the compact package-filtered snapshot:

bash uv run --no-project --with uiautomator2 python \ <skill>/scripts/android_inspect.py ui --serial "$ANDROID_SERIAL" \ --package com.android.settings

<skill> is this installed Skill directory, not the repository source. Use a compatible uiautomator2 version in an isolated environment; record the version used when reproducibility matters. The helper keeps hierarchy links, labels, hints, bounds, and control state. Other packages expose only overlay geometry. It masks password nodes and common token forms; treat all output as private and inspect the requested app only. This is not a general secret detector. 3. Use fresh observed selectors or bounds with uiautomator2.connect(serial), or adb -s "$ANDROID_SERIAL" …. Read the state after app transitions and actions. When the result is uncertain, inspect before retrying. Screenshots help when a hierarchy cannot explain a visible control or overlay.

Read connection setup and operation recipes for USB/wireless access, installation, temporary screen settings, and UI recovery. Use the recipient's available tools and existing permissions; this package does not assume an operating system, phone model, app roster, or credential store.

The helper requires Python 3.9+ and adb on PATH for inventory; UI inspection also requires uiautomator2. uv is optional. Commands accept --timeout (default 20 seconds) to bound each ADB request or the entire UI inspection subprocess. Never treat masked output as safe for publication: identifiers, ordinary labels, and unrecognized secrets can remain.

Operate and verify

Keep useful work reusable

Use the bundled inspection helper before writing another XML dump/parser. Prototype new operations in task-local scratch space. When an operation is repeated, fragile, or costly to rediscover, consider retaining a small script or app-specific recipe with the affected project's maintenance owner. Parameterize device, package, and task paths; use observed selectors and explicit preconditions, and verify the outcome. Keep one-off coordinates, expiring ports, tokens, private UI dumps, screenshots, downloaded APKs, and task logs out of the package. Remove exact temporary files created by the task after validation. Do not turn a single successful interaction into a scheduler or a general automation framework without a current need.