Android Viewer
v1.0.2Drive Android emulators: screenshots, taps, swipes, keys, text, rotation and foldable postures.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_devices List devices
Lists the AVDs on this machine (with serial and booted when the emulator is running) and the adb devices that are not AVDs. An AVD with serial null is stopped: start it with launch_avd.
get_state Device state
Size and rotation of the active display, current posture and available postures (foldables). Includes the viewer URL to watch the device in a browser pane.
| Parameter | Type | Description |
|---|---|---|
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
screenshot Screenshot
Captures the active display (PNG). For tap/swipe use normalized coordinates: x = pixel_x / image width, y = pixel_y / image height.
| Parameter | Type | Description |
|---|---|---|
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
tap Tap
Taps a point on the screen (input tap).
| Parameter | Type | Description |
|---|---|---|
x * | number | x coordinate, normalized 0–1 over the screenshot |
y * | number | y coordinate, normalized 0–1 over the screenshot |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
swipe Swipe
Swipes from one point to another (input swipe). With the same start and end point and a duration ≥ 500 ms it is a long press.
| Parameter | Type | Description |
|---|---|---|
x1 * | number | Start x, normalized 0–1 over the screenshot |
x2 * | number | End x, normalized 0–1 over the screenshot |
y1 * | number | Start y, normalized 0–1 over the screenshot |
y2 * | number | End y, normalized 0–1 over the screenshot |
duration_ms | integer | Gesture duration in ms |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
press_key Press key
Presses a system key (input keyevent).
| Parameter | Type | Description |
|---|---|---|
key * | string | Key |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
type_text Type text
Types ASCII text into the focused field (input text). For Enter use press_key.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
launch_avd Launch AVD
Starts an emulator by AVD name (see list_devices). Returns right away: wait until list_devices shows it with booted=true before using it.
| Parameter | Type | Description |
|---|---|---|
avd * | string | AVD name, e.g. Pixel_10_Pro_Fold |
rotate Rotate
Rotates the emulator 90° (like the emulator's rotate button). Emulators only.
| Parameter | Type | Description |
|---|---|---|
direction * | string | Direction |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |
set_posture Set posture
Changes the posture of a foldable. On emulators it moves the simulated hinge (`emu posture`); on physical devices or for REAR_DISPLAY it uses `cmd device_state state`. Accepts the name (closed, half_opened, opened, rear_display), the numeric id or "reset" to go back to the sensor posture. Returns the new state.
| Parameter | Type | Description |
|---|---|---|
posture * | Name, id or "reset" | |
serial | string | adb serial (e.g. emulator-5556). Optional when only one device is connected. |