|
| 1 | +# android-cli |
| 2 | + |
| 3 | +Gradle settings plugin wrapping Google's agent-first `android` CLI. |
| 4 | + |
| 5 | +Plugin ID: `zone.clanker.gradle.android-cli` |
| 6 | +Artifact: `zone.clanker:android-cli` |
| 7 | + |
| 8 | +## Target CLI |
| 9 | + |
| 10 | +This plugin targets Google's `android` CLI as documented at |
| 11 | +<https://developer.android.com/tools/agents/android-cli>. |
| 12 | + |
| 13 | +Verified against the following surface: |
| 14 | + |
| 15 | +``` |
| 16 | +Usage: android [-hV] [--sdk=PARAM] [COMMAND] |
| 17 | + -h, --help Show this help message and exit. |
| 18 | + --sdk=PARAM Path to the Android SDK |
| 19 | + -V, --version Print version information and exit. |
| 20 | +Commands: |
| 21 | + create Create a new Android project |
| 22 | + describe Analyzes an Android project to generate descriptive metadata. |
| 23 | + docs Android documentation commands |
| 24 | + emulator Emulator commands |
| 25 | + help Shows the help of all commands |
| 26 | + info Print environment information (SDK Location, etc.) |
| 27 | + init Initializes the environment (eg. skills) for Android CLI. |
| 28 | + layout Returns the layout tree of an application |
| 29 | + run Deploy an Android Application |
| 30 | + screen Commands to view the device |
| 31 | + sdk Download and list SDK packages |
| 32 | + skills Manage skills |
| 33 | + update Update the Android CLI |
| 34 | +``` |
| 35 | + |
| 36 | +The plugin wraps a subset of these subcommands as Gradle tasks (see below). |
| 37 | +Anything the plugin does not model directly is reachable via `android-run` |
| 38 | +with `-Pzone.clanker.android-cli.args="..."`. |
| 39 | + |
| 40 | +## Usage |
| 41 | + |
| 42 | +```kotlin |
| 43 | +// settings.gradle.kts |
| 44 | +plugins { |
| 45 | + id("zone.clanker.gradle.android-cli") version "<version>" |
| 46 | +} |
| 47 | + |
| 48 | +androidCli { |
| 49 | + // binary = "android" // override if not on PATH |
| 50 | + // extraArgs = listOf("--verbose") // appended to every invocation |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## Tasks |
| 55 | + |
| 56 | +| Task | What it runs | |
| 57 | +|------|--------------| |
| 58 | +| `android-version` | `android version` | |
| 59 | +| `android-describe` | `android describe` (`-Pzone.clanker.android-cli.json=true` for JSON) | |
| 60 | +| `android-screen-capture` | `android screen capture` | |
| 61 | +| `android-skills-list` | `android skills list` | |
| 62 | +| `android-skills-find` | `android skills find [query]` (`-Pzone.clanker.android-cli.query=<term>`) | |
| 63 | +| `android-skills-add` | `android skills add <name>` (`-Pzone.clanker.android-cli.skill=<name>`) | |
| 64 | +| `android-skills-remove` | `android skills remove <name>` | |
| 65 | +| `android-run` | `android <args>` (`-Pzone.clanker.android-cli.args="a b c"`) | |
| 66 | + |
| 67 | +Each task extends `Exec` and pre-checks that the `android` binary is on `PATH`. |
0 commit comments