# Tap, swipe, type, read the UI tree or manage apps on an Android phone `POST /v1/sandboxes/{sandbox}/phone` **In this build:** Works on the simulator or a real VM. Real VMs run each action through adb inside the sandbox; the emulator and its AOSP image install on first use, which needs network. The simulator answers with labelled stand-ins. **Scope:** `desktop` **CLI:** `harebox phone` ## Request: `PhoneAction` | Field | Type | Notes | |---|---|---| | `action` (required) | `string` | One of: `tap`, `swipe`, `type`, `key`, `ui_tree`, `screenshot`, `install_apk`, `list_apps`, `open_app`, `stop_app`, `open_url` | | `x` | `integer` | | | `y` | `integer` | | | `x2` | `integer` | Where a swipe ends. | | `y2` | `integer` | | | `duration_ms` | `integer` | | | `text` | `string` | | | `key` | `string` | An Android key code name without KEYCODE_, such as HOME, BACK or ENTER. | | `package` | `string` | An app's package name, such as com.example.app. | | `url` | `string` | | | `apk_path` | `string` | An APK uploaded into the sandbox, such as /home/user/app.apk. | ## Response: 200 `PhoneResult` | Field | Type | Notes | |---|---|---| | `ok` (required) | `boolean` | | | `action` (required) | `string` | | | `simulated` | `boolean` | | | `width` | `integer` | | | `height` | `integer` | | | `ui_tree` | `string` | uiautomator's XML of what is on screen. | | `screenshot_png_base64` | `string` | | | `apps` | `array` | | Errors follow [one format](../errors.html).