UiAutomatorTreeBuilder

class UiAutomatorTreeBuilder(maxDepth: Int = 50)

Builds ApiUiNode trees via UiAutomation accessibility path only.

The former UiObject2 path (device.findObject + traversal) is intentionally removed: it performs a full-tree search query per call and makes one IPC round-trip per node when traversing. For large WebView trees this floods the accessibility IPC socket and kills the UiAutomation connection. rootInActiveWindow() is a single IPC call that returns the root node and is significantly less disruptive.

Constructors

Link copied to clipboard
constructor(maxDepth: Int = 50)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun buildAllWindowTrees(): List<ApiUiNode>

Returns list of ApiUiNode roots (at most one — the active window).