Troupeby AliveDocsSign in

Reference

ui

The accessibility tree, resolved on the device: snapshots, queries and waits. Index · shared schemas · errors.

ProcedureSummaryRESTMCP toolStability
ui.snapshotTake an accessibility snapshot with element refs. format defaults to aria.GETui_snapshotstable
ui.queryResolve a locator once, with no waiting: one device round trip. The test framework's assertion polls use it.POSTui_querystable
ui.waitForWait for a locator to reach a statePOSTui_waitForstable
ui.describeAtHit-test a point. Returns the node, its ancestors and the best unique locator (codegen, pick-locator, inspector). When the app's JavaScript runtime is connected (a React Native debug build launched with devServerUrl, or debug.connect), react also names the React components that rendered the element there, innermost first, each with the source file and line where it was written.GETui_describeAtstable

ui.snapshot

Take an accessibility snapshot with element refs. format defaults to aria.

RESTGET /v1/ui/snapshot (input as query parameters)
RPC/rpc/v2/ui/snapshot
MCPtool ui_snapshot; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Requiresui.tree
Troupe Cloudrelayed through the host agent to the device host’s runtime
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  scope?: LocatorRoot  // default 'app'
  bundleId?: BundleId
  format?: 'aria' | 'tree' | 'both'  // default 'aria'
  includeHidden?: boolean  // default false
  maxNodes?: integer  // default 5000; ≥ 1
}

Output:

TypeScript
{
  snapshotId: SnapshotId
  takenAt: string
  aria?: string
  tree?: A11yNode
  nodeCount: integer
  truncated: boolean
}

Errors: S, APP_NOT_RUNNING, APP_CRASHED.

Named types: A11yNode, BundleId, LocatorRoot, SessionId, SnapshotId.

ui.query

Resolve a locator once, with no waiting: one device round trip. The test framework's assertion polls use it.

RESTPOST /v1/ui/query (input as a JSON body)
RPC/rpc/v2/ui/query
MCPtool ui_query; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Requiresui.tree
Troupe Cloudrelayed through the host agent to the device host’s runtime
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  locator: Locator
  limit?: integer  // default 50; 1–500
}

Output:

TypeScript
{ count: integer; matches: A11yNode[] }

Errors: S, APP_NOT_RUNNING, APP_CRASHED.

Named types: A11yNode, Locator, SessionId.

ui.waitFor

Wait for a locator to reach a state

RESTPOST /v1/ui/wait-for (input as a JSON body)
RPC/rpc/v2/ui/waitFor
MCPtool ui_waitFor; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Requiresui.tree
Troupe Cloudrelayed through the host agent to the device host’s runtime
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  locator: Locator
  state?: 'visible' | 'attached' | 'hidden' | 'detached'  // default 'visible'
  strict?: boolean  // default true
  timeoutMs?: TimeoutMs  // default 5000
}

Output:

TypeScript
{ count: integer; matches: A11yNode[] }

Errors: S, TIMEOUT, LOCATOR_STRICT_VIOLATION, APP_NOT_RUNNING, APP_CRASHED.

Named types: A11yNode, Locator, SessionId, TimeoutMs.

ui.describeAt

Hit-test a point. Returns the node, its ancestors and the best unique locator (codegen, pick-locator, inspector). When the app's JavaScript runtime is connected (a React Native debug build launched with devServerUrl, or debug.connect), react also names the React components that rendered the element there, innermost first, each with the source file and line where it was written.

RESTGET /v1/ui/describe-at (input as query parameters)
RPC/rpc/v2/ui/describeAt
MCPtool ui_describeAt; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Requiresui.tree; ui.describeAt
Troupe Cloudrelayed through the host agent to the device host’s runtime
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  x: number
  y: number
  scope?: LocatorRoot  // default 'app'
}

Output:

TypeScript
{
  node?: A11yNode
  ancestors: A11yNode[]
  locator?: LocatorOut
  locatorCode?: string
  unique: boolean
  react?: ReactAtPoint
}

Errors: S, APP_NOT_RUNNING.

Named types: A11yNode, LocatorOut, LocatorRoot, ReactAtPoint, SessionId.

esc

    Type to search every page, the protocol reference and the cloud API.