agentest_connect
Connect to an Android emulator or device and launch the app to get the initial UI screen in compact text format with @ref tokens for use as selectors in subsequent test steps.
Instructions
Connect to an Android emulator/device and launch the app. Returns the initial UI screen in compact text format with @ref tokens you can use as selectors.
The compact format uses one line per element: @b1 btn "Sign in" — button, ref @b1 @f1 input "Email" — text field, ref @f1 @c1 check "Remember me" — checkbox @s1 scroll — scrollable area @l1 link "Forgot?" — clickable text link @g1 tap — generic clickable (unlabeled) "plain text" — non-interactive text
Use refs in subsequent run_flow steps: { "action": "tap", "target": { "ref": "@b1" } } Traditional selectors (id/text/className/description) still work alongside refs.
Pass verbose:true to include framework-sync diagnostics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backend | No | Input backend: "auto" (default) tries gRPC then falls back to ADB; "adb" forces ADB only; "grpc" requires gRPC (emulator only). | |
| verbose | No | Include framework-sync diagnostics in the response. | |
| deviceId | No | Specific device/emulator ID from "adb devices". Omit to use the first connected device. | |
| packageName | Yes | Android package name (e.g. "com.example.myapp") |