# Androperator Documentation Optional full reference compiled from the public navigation pages; installed skills and internal design notes are separate. Source revision: `3ac0d007eeadcce3dad9ce24d1513a02da162a9c`. Source CLI package version: `1.4.1`. Assembled content SHA-256: `8c40199bd824c422730d296c6376147daf49a0a0ddaddb2cdb9d7c3227ec12b8`. These docs describe this source build, not proof of the currently published release. Check installed CLI/Operator compatibility before relying on version-specific behavior. Source: [Docs Home](https://docs.androperator.com/) | `index.md` # Docs Home Androperator is a deterministic actuator tool for Android device automation. Use this page as the routing index into the authored docs. The concrete machine entry points are `llms.txt` and `llms-full.txt`. --- **Current release: [1.4.0](https://github.com/androperator/androperator/releases/tag/v1.4.0)** --- ## Version Quick Reference Check your CLI version: ```bash androperator version ``` Check CLI and APK compatibility: ```bash androperator version --check-compat --device --operator-package ``` See [Version Compatibility](https://docs.androperator.com/troubleshooting/compatibility/) for detailed compatibility rules and recovery. ## Agent Entry Points - [llms.txt](https://docs.androperator.com/llms.txt) - compact machine entrypoint - [llms-full.txt](https://docs.androperator.com/llms-full.txt) - full machine-readable docs corpus Verification pattern: ```bash curl -fsSL https://docs.androperator.com/llms.txt curl -fsSL https://docs.androperator.com/llms-full.txt ``` Use: - `llms.txt` when you want the compact docs index - `llms-full.txt` when you want the full assembled documentation corpus ## Setup - [Setup](https://docs.androperator.com/setup/) - install the CLI, prepare a device, install the Operator APK, verify readiness, and run the first snapshot - [Host Agent Orientation](https://docs.androperator.com/host-agents/) - canonical post-install route for using CLI, MCP or HTTP execution - [Quickstart](https://docs.androperator.com/quickstart/) - the observe/decide/act loop: taking snapshots, reading the hierarchy, and sending actions ## API - [Overview](https://docs.androperator.com/api/overview/) - execution payload, result envelope, and branching model - [CLI Reference](https://docs.androperator.com/api/cli/) - generated command and flag reference - [Actions](https://docs.androperator.com/api/actions/) - canonical action types and parameter semantics - [Selectors](https://docs.androperator.com/api/selectors/) - `NodeMatcher` contract and CLI selector mapping - [Snapshot Format](https://docs.androperator.com/api/snapshot/) - where `snapshot` XML lives and how extraction works - [Errors](https://docs.androperator.com/api/errors/) - public error-code contract and recovery patterns - [Devices](https://docs.androperator.com/api/devices/) - device discovery and deterministic targeting - [Doctor](https://docs.androperator.com/api/doctor/) - doctor report contract and readiness checks - [Timeouts](https://docs.androperator.com/api/timeouts/) - execution and action timeout budgeting - [Environment Variables](https://docs.androperator.com/api/environment/) - current `ANDROPERATOR_*` and runtime environment controls - [Serve API](https://docs.androperator.com/api/serve/) - local HTTP and SSE contract - [MCP Server](https://docs.androperator.com/api/mcp/) - stdio MCP server for MCP clients such as Claude Desktop - [Navigation Patterns](https://docs.androperator.com/api/navigation/) - composed navigation workflows for agents - [Recording Format](https://docs.androperator.com/api/recording/) - raw NDJSON recording schema and parsed step log ## Skills - [Overview](https://docs.androperator.com/skills/overview/) - instructions followed by the current agent - [Authoring](https://docs.androperator.com/skills/authoring/) - adaptive instructions and optional evidence - [Personalized Skills](https://docs.androperator.com/skills/personalized-skills/) - host instructions and privacy boundaries - [Development Workflow](https://docs.androperator.com/skills/development/) - local iteration loop for skills - [Device Prep and Runtime](https://docs.androperator.com/skills/runtime/) - device readiness and verified outcomes ## Troubleshooting - [Androperator Operator App](https://docs.androperator.com/troubleshooting/operator/) - installation, permission, handshake, and crash recovery - [Known Issues](https://docs.androperator.com/troubleshooting/known-issues/) - currently verified known issues page - [Version Compatibility](https://docs.androperator.com/troubleshooting/compatibility/) - CLI and Operator APK version alignment Androperator is open source. If these docs help, see the [project on GitHub](https://github.com/androperator/androperator). --- Source: [Setup](https://docs.androperator.com/setup/) | `setup.md` # Setup ## Purpose Get from an empty host to a first successful `androperator snapshot` with one deterministic path and machine-checkable success conditions. ## Prerequisites | Requirement | Minimum | Machine check | | --- | --- | --- | | Node.js | v24+ | `node -v` | | Java | 17 or 21 | `java -version` | | adb | On `PATH` | `adb version` | | Android target | One device or emulator visible to adb | `androperator devices` | **Java note:** The installer provisions Java 17 automatically on supported platforms (macOS with Homebrew, Ubuntu/Debian, Arch). Java 17 or 21 is required as the host JDK for Android builds (AGP 8.x requirement). The Android Gradle build compiles Java and Kotlin with Java 17 settings; device compatibility is handled by Android's DEX pipeline, not by targeting an older bytecode level. ## Agent-directed setup When a user wants an outside agent to install, repair, verify, and orient Androperator, give the agent this prompt: ```text Read https://androperator.com/skill.md and get me set up with Androperator. ``` `https://androperator.com/skill.md` is the public setup skill for agents. It is the pre-install entrypoint that tells an agent when to use the shell installer, when to use direct npm install, when to run `androperator install`, which readiness checks prove setup, and which human approval boundaries must stop the agent. The public skill does not replace `androperator install`. It points the agent to `androperator install` as the canonical post-bootstrap route after the CLI exists. After install, local host-specific orientation moves to: | Path | Use | | --- | --- | | `~/.androperator/AGENTS.md` | Local guide written by host setup for the current machine. | | `~/.androperator/install-state.json` | Install metadata, APK version, and last device serial when known. | | `~/.androperator/mcp-config-snippet.json` | Generated stdio MCP configuration for hosts that choose `androperator mcp serve`. | Machine-checkable verification after an agent-directed setup: ```bash androperator doctor androperator devices androperator snapshot --device test -f ~/.androperator/AGENTS.md test -f ~/.androperator/mcp-config-snippet.json ``` Continue only when `androperator doctor` exits `0`, `criticalOk` is `true`, and the snapshot command returns a successful result envelope. Human action can still be required for OS prompts, Developer Options, USB debugging authorization, Android accessibility permission, notification permission, app installation, app sign-in, and choosing the correct device when multiple targets are connected. ## 1. Install the CLI Recommended - the installer handles Node, Java 17, adb, CLI bootstrap, and the delegated `androperator install` flow in one step: ```bash curl -fsSL https://androperator.com/install.sh | bash ``` When bootstrapping nvm, the installer downloads version 0.40.1 over HTTPS and verifies its pinned SHA-256 checksum with `sha256sum` or `shasum` before running it. A missing checksum tool, failed download, or checksum mismatch stops setup. If the installer succeeds, skip to [5. Verify readiness with doctor](https://docs.androperator.com/setup/#5-verify-readiness-with-doctor). When more than one adb-visible device is present, the installer reports each detected device, runs `doctor` against each ready `adb` device, installs the current release APK on any ready device that is missing or incompatible, and then finishes with explicit `--device ` guidance for later commands. Alternatively, install the CLI only via npm (Node.js 24+ required): ```bash npm install -g @androperator/cli ``` Or use Homebrew, which provides Node and uses the published npm archive: ```bash brew install androperator/tap/cli # Optional standalone emulator command: brew install androperator/tap/emulator ``` These install `androperator` and `androperator-emulator`, respectively. The CLI already includes the emulator library, so the second formula is optional. Java, Android SDK tools, and device permissions still need setup. If moving from a global npm installation, first run `npm uninstall -g androperator @androperator/cli` (and `npm uninstall -g @androperator/emulator` for its standalone command) to avoid executable conflicts. Upgrade a Homebrew-managed CLI with `brew upgrade androperator/tap/cli`; upgrade its standalone emulator with `brew upgrade androperator/tap/emulator`. Run `brew update` first if Homebrew's local definitions are stale. New versions become available after the tap's automatic validation succeeds; Homebrew can hold dependencies for 24 hours after npm publication. Do not use npm to update a Homebrew-managed command. The shell installer preserves Homebrew ownership when the active CLI is linked to that formula; an unlinked formula does not take over a CLI installed through npm. Then run the canonical post-bootstrap install flow: ```bash androperator install ``` Success conditions: - `androperator version` exits `0` and prints a version string. - If you used `install.sh`, the delegated install flow downloads the current release APK when remediation needs setup and no reusable local copy is already in place. For later manual setup or recovery, redownload from `https://androperator.com/operator.apk` or use `androperator operator download`. ### Durable host-agent artifacts from `androperator install` After shell bootstrap succeeds, `install.sh` delegates to `androperator install`. That CLI-owned post-bootstrap flow runs operator remediation, bundled-skills install, and `androperator host setup`, then writes these durable onboarding files under `~/.androperator/`: | Path | Meaning | When to read it | | --- | --- | --- | | `~/.androperator/AGENTS.md` | Local Androperator guide with agent control-loop guidance and current bundled-skills status | First stop for a host agent that needs to discover what Androperator can do on this machine | | `~/.androperator/install-state.json` | Durable install metadata written by `androperator host setup` during install | Use when you need the last known install facts without rerunning `doctor` | | `~/.androperator/mcp-config-snippet.json` | Paste-ready MCP config for Claude Desktop, Codex, and a generic stdio MCP consumer | Use when the host should connect through `androperator mcp serve` instead of shelling out to the CLI | During `androperator install`, `apkVersion` comes from the final passing version check for the single connected device and selected Operator package. It remains `null` when no single device is selected or final version evidence is unavailable. It is an observed APK version, not a copy of the CLI version or download target; it does not prove that every readiness check passed. Shell prerequisite failures exit before these files are written. After `install.sh` delegates to `androperator install`, later remediation or device readiness failures can still leave these files behind because host setup runs before the CLI returns its final install status. Bundled host guidance has a canonical store at `~/.androperator/bundled-skills/`. Claude receives managed links in `~/.claude/skills/`. Codex and other shared consumers use managed directory copies in `~/.agents/skills/`. Aliased discovery locations share the generic managed copies. Conflicting user-owned content is preserved and reported as an install warning, never silently overwritten. Use `androperator bundled-skills list` to inspect installed instructions and [host orientation](https://docs.androperator.com/host-agents/) to choose execution and evidence tools. ## 2. Prepare the Android target Required device state: 1. Enable Developer options (Settings > About phone > tap Build Number 7 times). 2. Enable USB debugging (Settings > Developer options > USB debugging). 3. Connect the device via USB, or boot an emulator via Android Studio or `androperator emulator create`. 4. Accept the adb authorization prompt if Android shows one. Emulators have USB debugging enabled by default. Physical devices require steps 1-2 and the RSA key acceptance in step 4. Success condition: ```bash androperator devices ``` Expected output shape: ```json {"devices":[{"serial":"","state":"device"}]} ``` If state is `unauthorized`, unlock the device and accept the USB debugging prompt. If state is `offline`, restart adb: ```bash adb kill-server && adb start-server ``` If more than one target is connected, record the serial you will use and pass `--device ` on every later command. ## 3. Install the Operator APK To avoid stale cached copies, always refresh the stable release APK before running setup or reinstall: ```bash mkdir -p ~/.androperator/downloads curl -fsSL https://androperator.com/operator.apk -o ~/.androperator/downloads/operator.apk ``` Canonical public APK URL: `https://androperator.com/operator.apk` Keep the CLI and Operator APK on matching releases. Run `androperator doctor` to check version compatibility and device readiness before issuing UI commands. ```bash androperator operator setup --apk ~/.androperator/downloads/operator.apk ``` With explicit device targeting: ```bash androperator operator setup --apk ~/.androperator/downloads/operator.apk --device ``` For a local debug APK instead of the release APK: ```bash androperator operator setup \ --apk \ --device \ --operator-package com.androperator.operator.dev ``` | Variant | Package name | When to use | | --- | --- | --- | | Release | `com.androperator.operator` | Default. Installed by the installer. | | Debug | `com.androperator.operator.dev` | Local development, built from source. | The CLI auto-detects which variant is installed when exactly one is present. If both are installed, pass `--operator-package` explicitly. Behavior: - Installs the APK on the device via adb. - Grants accessibility and notification permissions. - Verifies package presence and a live, correlated Operator handshake. - If the accessibility service is unavailable after installation, retries its grant and handshake at most twice while preserving other enabled services. - Does not wake or unlock the device. The existing doctor ping can dismiss an open notification shade on Android 12+. Success condition: - `verification.ok` and `verification.readiness.ok` are `true`. The recorded `verification.readiness.attempts` retain any failed probes before recovery. - A follow-up `androperator doctor` passes interactive readiness. Setup verifies the service connection; it does not establish that a locked phone is usable. An unavailable service after bounded recovery returns `OPERATOR_VERIFY_FAILED`; a failed permission repair returns `OPERATOR_GRANT_FAILED`. Transport or malformed handshake failures stop verification without re-granting permissions. Do not use raw `adb install` for setup. The CLI setup command is the only path that performs install, permission grant, and verification as one operation. ## 4. Re-grant permissions (recovery only) ```bash androperator grant-device-permissions --device ``` Use this only after the Operator APK crashes or Android revokes accessibility / notification permissions. For the first install, use `androperator operator setup`. If you force-stop the Operator package during debugging and the next handshake or snapshot stops working, use this same recovery step before trusting the runtime again, then re-run `androperator doctor`. ## Optional video recording tools Video recording additionally requires separately installed scrcpy 3.0 or newer, ffprobe, and ffmpeg 6.1 or newer with the libx264 encoder on the host PATH. Androperator does not bundle or install them. On macOS: `brew install scrcpy ffmpeg`. `doctor` warns under `host.video.dependencies` when they are unavailable; this advisory does not block ordinary device readiness. Screenshots still require only ADB. See [video dependency setup and recovery](https://docs.androperator.com/api/evidence/#video-dependencies) for CLI, Node, and MCP error details. ## 5. Verify readiness with doctor ```bash androperator doctor ``` With explicit targeting: ```bash androperator doctor --device ``` ### Doctor checks Doctor checks host prerequisites, adb/device discovery, Operator APK presence, version compatibility, handshake readiness, and interactive device state. The full check order, `DoctorReport` shape, `checks[]` fields, `nextActions` behavior, and `--fix` semantics are owned by [Doctor](https://docs.androperator.com/api/doctor/#doctor-report-contract). ### Success conditions - Exit code `0` means all critical checks passed. - JSON has `"criticalOk": true`. - `checks[]` contains only `"pass"` or non-critical `"warn"` statuses. ### Doctor flags - `doctor --fix` can execute shell-type remediation steps from failed checks. - `doctor --check-only` uses the same readiness exit status as plain doctor: `0` only when required checks pass, otherwise `1`. Inspect `skippedChecks` when prerequisites prevent verification. See [Doctor](https://docs.androperator.com/api/doctor/) for the full report contract and [Errors](https://docs.androperator.com/api/errors/) for recovery by code. ## 6. Run the first command ```bash androperator snapshot ``` With explicit targeting: ```bash androperator snapshot --device ``` Success conditions: - Exit code `0`. - `envelope.status` is `"success"`. - `envelope.stepResults[0].actionType` is `"snapshot"`. - `envelope.stepResults[0].success` is `true`. - `envelope.stepResults[0].data.text` contains the XML hierarchy. If the snapshot step succeeds but `data.text` is missing, Node converts that step into `SNAPSHOT_EXTRACTION_FAILED`. ## Agent sequence ### Brain / hand model Androperator is the hand. The agent is the brain. The agent decides what to do, then calls the Node CLI or the local serve API with explicit commands and waits for a structured result envelope. ### Programmatic first-run sequence 1. Run `androperator doctor [--device ] [--operator-package ]`. 2. If `readiness.apk.presence` fails, run `androperator operator setup --apk ...`. 3. If `readiness.handshake` fails after a known-good install, run `androperator grant-device-permissions ...`. 4. For multiple failures, `androperator doctor --fix ...` auto-executes shell remediation steps. 5. Re-run `androperator doctor ...` and require `criticalOk: true`. 6. Run `androperator snapshot ...`. 7. Branch only on structured fields: `criticalOk`, `checks[].code`, `envelope.status`, `envelope.errorCode`, `stepResults[].success`. ### How to confirm success without a human - Treat `doctor` as ready only when `criticalOk` is `true`. - Treat a device command as successful only when `envelope.status` is `"success"` and every `stepResults[].success` is `true`. - Prefer exact codes over message matching. Examples: `NO_DEVICES`, `OPERATOR_NOT_INSTALLED`, `RESULT_ENVELOPE_TIMEOUT`. ### Common first-run failures and recovery | Code | Meaning | Recovery | | --- | --- | --- | | `NO_DEVICES` | No adb target in state `device` | Connect or boot a target, rerun `androperator devices` then `doctor`. | | `DEVICE_UNAUTHORIZED` | adb key prompt not accepted | Accept the prompt on the device screen, rerun `doctor`. | | `DEVICE_OFFLINE` | Device unreachable | `adb kill-server && adb start-server`, rerun `doctor`. | | `MULTIPLE_DEVICES_DEVICE_ID_REQUIRED` | More than one target connected | Pick a serial from `androperator devices`, pass `--device ` to all commands. | | `OPERATOR_NOT_INSTALLED` | Expected package missing | `androperator operator setup --apk [--device ]`. | | `OPERATOR_VARIANT_MISMATCH` | Release/debug package mismatch | Pass `--operator-package ` or reinstall the intended APK. | | `DEVICE_ACCESSIBILITY_NOT_RUNNING` | Handshake returned a runtime failure | `androperator grant-device-permissions [--device ]`, rerun `doctor` and `snapshot`. | | `RESULT_ENVELOPE_TIMEOUT` | Broadcast sent, no result envelope arrived | If no correlated log lines were captured, run `doctor` to check version compatibility and accessibility; otherwise re-grant permissions, rerun `snapshot --timeout 5000 --verbose`, and verify `--operator-package`. | | `VERSION_INCOMPATIBLE` | CLI and APK version mismatch | Update the CLI with its existing manager (`brew upgrade androperator/tap/cli` or `npm install -g @androperator/cli@latest`) or reinstall the APK to align versions. | ### When to pass `--device` and `--operator-package` - `--device `: required when more than one target is connected. - `--operator-package `: required when both release and debug variants are installed on the same device. For deterministic automation, always pass both flags explicitly. ## Debugging setup issues If setup fails, use `androperator logs` to inspect what happened: ```bash # Stream logs in one terminal androperator logs # Run the failing command in another terminal androperator doctor --device --operator-package ``` Log file location: `~/.androperator/logs/androperator-YYYY-MM-DD.log` Key events to look for: - `doctor.check` - Individual doctor check results - `adb.command` / `adb.complete` - ADB operations - `preflight.apk.pass` / `preflight.apk.missing` - APK presence checks See [Logging](https://docs.androperator.com/api/logging/) for complete documentation. ## Related pages - [Host Agent Orientation](https://docs.androperator.com/host-agents/) - [Quickstart](https://docs.androperator.com/quickstart/) - [API Overview](https://docs.androperator.com/api/overview/) - [Devices](https://docs.androperator.com/api/devices/) - [Doctor](https://docs.androperator.com/api/doctor/) - [Errors](https://docs.androperator.com/api/errors/) - [Environment Variables](https://docs.androperator.com/api/environment/) - [Troubleshooting](https://docs.androperator.com/troubleshooting/operator/) - [Logging](https://docs.androperator.com/api/logging/) ## Caller-Controlled Default Application Preparation Some flows require a default browser before automation starts. Doctor verifies the selected Operator; it does not assign Android application roles or choose a default application. Provision roles separately on a dedicated test device. Inspect the shell capabilities and read the current role holder first: ```bash DEVICE_ID= APPLICATION_ID= adb -s "$DEVICE_ID" shell cmd role help adb -s "$DEVICE_ID" shell cmd role get-role-holders --user 0 android.app.role.BROWSER ``` Only if the device supports these commands and changing that default is intended, assign the role and read it back: ```bash adb -s "$DEVICE_ID" shell cmd role add-role-holder --user 0 android.app.role.BROWSER "$APPLICATION_ID" adb -s "$DEVICE_ID" shell cmd role get-role-holders --user 0 android.app.role.BROWSER ``` A nonzero assignment status or a readback that does not contain the intended application is preparation failure. Do not continue on the strength of command acceptance alone. Shell role capabilities vary by Android version and device; inspect `help` on the actual target. This recipe's read-only capability checks were verified on an API 35 emulator. That emulator printed the supported commands but returned a nonzero status for `help`; the role-holder read returned zero. Role assignment and physical-device behavior are not part of the readiness proof. ## Sensitive hierarchy access The Operator can read views Android marks as accessibility-data sensitive. Both development and release APKs declare `android:isAccessibilityTool="true"`. Android [defines this declaration](https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#attr_android:isAccessibilityTool) as identifying services used to assist users with disabilities. Androperator is distributed outside Google Play. Install the matching APK using `androperator operator setup --apk ` with the explicit device and Operator package. Wait for setup to succeed before issuing UI commands. If the accessibility service is unavailable, enable the selected Operator in Android accessibility settings and run `androperator doctor`. If it is already enabled but remains unavailable, turn it off and back on, then rerun doctor. Queries and XML snapshots work on supported Android versions. The [per-node sensitivity flag](https://docs.androperator.com/api/actions/#action-query-ui) is available on Android 14 (API 34) and later. On earlier versions, queries report `accessibilityDataSensitive: null` and XML omits `accessibility-data-sensitive`. This API requirement applies to the flag, not to queries or XML capture. Applications can still have no accessible hierarchy. Sensitivity metadata does not change screenshot capture, redaction, or logging behavior. For screen-off notification/media observation, use `androperator doctor --capability background-observation` after setup. The default interactive doctor can fail on a locked screen while these reads remain available. See [background readiness](https://docs.androperator.com/api/doctor/#background-observation-readiness). ## Screenshot capture prerequisites Screenshots default to 25% per dimension. See [choosing a capture size](https://docs.androperator.com/api/actions/#choosing-screenshot-scale) for agent guidance and explicit full-size recovery. `screenshot --scale 100|50|25` automatically deploys the bundled shell capture helper on first use. Direct capture needs authorized ADB, writable `/data/local/tmp` and a compatible Android capture interface. If helper setup is unavailable, Node captures normally and resizes to the requested dimensions. No extra Operator permission, root, Java installation or Android SDK is required on the host. The normal screenshot command remains full size. Direct capture at all three sizes is verified on an Android 17 phone and the available Android 15, 16 and 17 emulators. Missing protected GPU composition does not prevent screenshots: the result reports `protectedContent: "unknown"` when Android cannot establish whether content was redacted. The fallback always reports that unknown state and `captureMethod: "adb_screencap_resize"`. It reduces image size, without promising faster acquisition. Protected buffers are never read, and Android's normal content protections remain in force. Run `androperator doctor --device --operator-package com.androperator.operator.dev` to see direct-helper capability in `capture.reduced`. Doctor temporarily deploys and probes the helper without capturing pixels. A helper warning does not fail core readiness or rule out stock/resize capture. See the [screenshot contract](https://docs.androperator.com/api/actions/#action-take-screenshot) for exact fields, compatibility, fallback boundaries and failure recovery. ## Disable the accessibility service for performance measurements The Operator app shows whether its accessibility service is Running or Disabled. Tap **Disable Androperator** to disconnect this app's service. Android accessibility processing can substantially affect frame timings in the app under test, even when no agent commands are running. Measure performance in a separate run with the service disabled and report which services were enabled. The button disables only this installed Operator variant's accessibility service. Other accessibility services, including other Operator variants, remain enabled. It does not revoke notification access or disable background notification/media observation. Accessibility actions and snapshots are unavailable while disabled. To reconnect from an authorized adb host, have the agent run: ```bash androperator doctor --fix --device --operator-package com.androperator.operator.dev ``` Use `com.androperator.operator` for the release APK. Plain `doctor` diagnoses the state; `doctor --fix` executes available shell remediation and checks readiness again. Require exit code `0` and `criticalOk: true`, then verify the intended operation. Reopening the Operator app does not re-enable its accessibility service. ## View open source licenses Tap the information button in the Operator app's top-right corner to open the full-screen license list. Library license text and third-party notices are bundled in the APK and can be read offline. Back returns to the service screen. External links, such as GitHub's artwork terms, open in your browser and require internet access. --- Source: [Host Agent Orientation](https://docs.androperator.com/host-agents/) | `host-agents.md` # Host Agent Orientation Androperator is the deterministic hand for the current agent's brain. The agent owns planning, app strategy and verification; CLI, HTTP and MCP expose Android actions and evidence. A one-off goal does not require a reusable skill. ## Public Setup Skill The [public setup guidance](https://androperator.com/skill.md) covers installation. After setup, inspect `androperator bundled-skills list` for installed host instructions. Start with `androperator-agent-orientation` on an unfamiliar host; use `androperator-upgrade` for a whole-product refresh. ## Select the CLI and target Use `androperator devices`, choose an explicit target and run doctor with the matching Operator. In a development checkout, build `apps/node` and invoke `node apps/node/dist/cli/index.js` with `--operator-package com.androperator.operator.dev`. See [setup](https://docs.androperator.com/setup/). ## Choose readiness for the requested capability | Work | Gate and constraints | | --- | --- | | Interactive UI actions and ordinary snapshot | Interactive `doctor`: exit 0, `criticalOk: true`, `readiness.device.interactive.status: "pass"`. Ordinary execution preparation may attempt wake/Home; it does not unlock the device. | | Notification reads and media reads/controls only | `doctor --capability background-observation`; no wake, accessibility requirement or keyguard dismissal. Required service permissions and first unlock after reboot still apply. | | Still evidence capture | Use [evidence readiness](https://docs.androperator.com/api/evidence/); its hierarchy preparation is non-waking and component failures remain in the bundle. | Mixing UI actions or notification mutations into a background list restores whole-execution interactive readiness. Interactive doctor failure alone does not veto supported background-only work. A passing doctor establishes readiness, not app responsiveness or task success. See [background doctor](https://docs.androperator.com/api/doctor/#background-observation-readiness). ## Adaptive execution and goal coverage Define the requested outcome and budgets. Observe current state, choose one justified action, execute and verify its effect. Retain raw evidence, failures, and command/task correlation. Report partial or blocked outcomes truthfully. A successful command or a familiar route alone does not establish goal success. Use the installed `androperator-agent-control-loop` for adaptive navigation. Optional [Settings examples](https://docs.androperator.com/skills/examples/) illustrate independent value verification and bounded helpers. Follow instructions in the current agent; there is no Androperator runtime registry or child-agent requirement. ## Choose the transport Use CLI when the caller can launch shell commands on the adb/emulator host. Use stdio MCP when the client supports local MCP processes. Use [HTTP](https://docs.androperator.com/api/serve/#choose-the-transport) to reach a separate device host where the caller cannot launch CLI processes. See the Serve page for access control, completion, SSE scope and artifact locality. The same execution contracts apply. Optional shell helpers require suitable host execution support. ## Author when useful Explore the authorized workflow directly. Save reusable instructions when requested or worthwhile, using `androperator-skill-author-by-agent-discovery` for bounded exploration. Use `androperator-learn-from-recording` only when a demonstration adds missing evidence. Human recording is optional. Read [authoring](https://docs.androperator.com/skills/authoring/). ## Durable Post-Install Files Install writes `~/.androperator/install-state.json`, `mcp-config-snippet.json` and `AGENTS.md`. When `~/.agents/AGENTS.md` already exists, host setup updates one bounded bridge to the local guide. Bundled guidance is installed in `~/.androperator/bundled-skills/` and made discoverable to supported agent hosts. No runtime registry or child-agent CLI is needed by install or normal doctor. --- Source: [Quickstart](https://docs.androperator.com/quickstart/) | `quickstart.md` # Quickstart ## Before You Start This page assumes a working Androperator installation: CLI installed, device connected, Operator APK installed, and interactive doctor exiting zero with `criticalOk: true` and `readiness.device.interactive.status: "pass"`. For background-only work, choose the [capability-specific gate](https://docs.androperator.com/host-agents/#choose-readiness). If you have not reached that state yet, complete [Setup](https://docs.androperator.com/setup/) first. If you are choosing between runtime-skill discovery, MCP, and direct CLI automation after install, read [Host Agent Orientation](https://docs.androperator.com/host-agents/) first. This page starts after that choice and focuses on direct observe / decide / act execution. --- ## The Automation Loop Androperator is a deterministic actuator. The agent reasons and decides; Androperator executes and returns structured data. Every automation follows the same three-step loop: ``` Observe -> Decide -> Act ``` 1. **Observe** - take a UI snapshot to read the current device state 2. **Decide** - parse the XML hierarchy to find the right node to target 3. **Act** - use a flat CLI command for one action, or `exec` for an explicit batch; inspect the result and observe the effect Repeat until the requested outcome is verified, or report a bounded partial/blocked outcome with retained evidence. After uncertain dispatch, inspect state before repeating any mutation. **Targeting rule:** do not guess selectors. If the next action needs a target, take a fresh `snapshot`, derive the selector from the current hierarchy, and then act. A guessed label failing is not an Androperator bug - it means the target was not proven from the current screen state. --- ## Choose the smallest useful call For a ready interactive target, use flat commands for single actions: ```bash androperator open com.android.settings --device androperator snapshot --device # Only after observing a unique current target: androperator click --text "About phone" --strict --device androperator snapshot --device ``` Labels and layout vary by device. Substitute selectors from current evidence. `open` already waits for its package to be foreground; it does not prove content readiness. After a same-package click, observe the destination; if content is still loading, use `wait --text --timeout 5000` and observe again. A label already present before the action proves no transition. Do not add a package-only `wait-for-nav` after a completed launch or in-app click. See [navigation semantics](https://docs.androperator.com/api/navigation/#wait-for-navigation). | Need | Observation | Limit | | --- | --- | --- | | Discover the screen | `snapshot` | Raw XML can be large | | Bound returned context | `snapshot --compact --max-nodes 100` | A preorder prefix; inspect truncation, never infer absence from omitted nodes | | Inspect matches/state | `query --text