Skip to main content
GET
/
devices
/
{deviceId}
/
ui-state
JavaScript
import Mobilerun from '@mobilerun/sdk';

const client = new Mobilerun({
  apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});

const response = await client.devices.state.ui('deviceId');

console.log(response.a11y_tree);
{
  "a11y_tree": {
    "boundsInScreen": {
      "bottom": 123,
      "left": 123,
      "right": 123,
      "top": 123
    },
    "children": "<array>",
    "className": "<string>",
    "contentDescription": "<string>",
    "isCheckable": true,
    "isChecked": true,
    "isClickable": true,
    "isEnabled": true,
    "isFocusable": true,
    "isFocused": true,
    "isLongClickable": true,
    "isPassword": true,
    "isScrollable": true,
    "isSelected": true,
    "packageName": "<string>",
    "resourceId": "<string>",
    "text": "<string>"
  },
  "device_context": {
    "display_metrics": {
      "density": 123,
      "densityDpi": 123,
      "heightPixels": 123,
      "scaledDensity": 123,
      "widthPixels": 123
    },
    "filtering_params": {
      "min_element_size": 123,
      "overlay_offset": 123
    },
    "screen_bounds": {
      "height": 123,
      "width": 123
    }
  },
  "ime_tree": {
    "boundsInScreen": {
      "bottom": 123,
      "left": 123,
      "right": 123,
      "top": 123
    },
    "children": "<array>",
    "className": "<string>",
    "contentDescription": "<string>",
    "isCheckable": true,
    "isChecked": true,
    "isClickable": true,
    "isEnabled": true,
    "isFocusable": true,
    "isFocused": true,
    "isLongClickable": true,
    "isPassword": true,
    "isScrollable": true,
    "isSelected": true,
    "packageName": "<string>",
    "resourceId": "<string>",
    "text": "<string>"
  },
  "phone_state": {
    "isEditable": true,
    "keyboardVisible": true,
    "activityName": "<string>",
    "currentApp": "<string>",
    "focusedElement": {
      "className": "<string>",
      "resourceId": "<string>",
      "text": "<string>"
    },
    "packageName": "<string>"
  },
  "$schema": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token via Authorization header

Headers

X-Device-Display-ID
integer<int64>
default:0
Required range: x >= 0

Path Parameters

deviceId
string
required

Query Parameters

filter
boolean
default:false

Response

OK

a11y_tree
object
required
device_context
object
required
ime_tree
object
required
phone_state
object
required
$schema
string<uri>
read-only

A URL to the JSON Schema for this object.

Example:

"https://example.com/schemas/AndroidState.json"