You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mobilecli: regressed at 1.0.1, still present through 1.0.10 (1.0.0 unaffected)
devicekit-android agent: 1.2.6
Device: Android emulator, google_apis system image, API 36 (Android 16)
Chrome: stable, Custom Tabs
Summary
Since #334 ("dump ui via persistent devicekit server on android") made Android dump ui reuse a single persistent DeviceKitServer UiAutomation for the whole session, the web form fields inside a Chrome Custom Tab (e.g. the <input>s of a hosted OAuth login) frequently never appear in dump ui. The Custom Tab's application window is dumped, but Chrome's renderer (web) accessibility nodes inside it are not populated.
The miss is sticky: because every dump in a session shares one UiAutomation, a client that polls for an element (e.g. a 30s locator wait in a UI-automation framework) never recovers — every poll reuses the same stale connection.
Root cause (from the code)
Chromium builds a Custom Tab's renderer accessibility tree when a fresh accessibility client connects.
Pre-feat: dump ui via persistent devicekit server on android #334, dump ui spawned a fresh one-shot ViewTreeDump instrumentation per call — a new UiAutomation (fresh a11y client) each dump — so Chrome (re)built the web tree, and a repeated/polling dump would eventually catch it.
feat: dump ui via persistent devicekit server on android #334 replaced that with one persistent DeviceKitServer UiAutomation, established once (typically before the Custom Tab's web content loads) and reused for every subsequent dump. With no new a11y client, Chrome never rebuilds the web tree — and because all dumps share that one connection, polling can't recover it.
#334's "output schema verified identical" check exercised native UI only, not a WebView/Custom Tab, so this regression wasn't caught.
Reproduction
Android emulator (google_apis, API 36), current Chrome.
mobilecli dump ui on some screen A — this starts the persistent DeviceKitServer (its UiAutomation connects now).
From an app, open a Chrome Custom Tab hosting a web form (any hosted OAuth login with <input> fields).
mobilecli dump ui (repeatedly) → the web <input> nodes are absent; only the native Custom Tab chrome + application window appear.
adb shell am force-stop com.mobilenext.devicekit to drop the persistent server, then mobilecli dump ui again → the server relaunches with a fresh UiAutomation and the web fields can appear.
Concretely: a locator that polls dump ui for one of the form inputs times out for the entire wait window under the persistent server, but resolves when a fresh instrumentation is used.
Not a fix
--full (#398) — that only un-filters TYPE_INPUT_METHOD (soft-keyboard) windows. The Custom Tab is a normal TYPE_APPLICATION window that is already dumped; the missing part is the renderer nodes inside it, which --full does not affect.
Workaround
Launch Chrome with --force-renderer-accessibility (write it to /data/local/tmp/chrome-command-line; requires a rootable/userdebug image + adb root), which forces Chrome to build the renderer tree from the DOM regardless of a11y-client lifecycle. Needs root; not viable on non-rootable / Play-Store images.
Or refresh / re-establish the UiAutomation a11y client when a WebView / Custom-Tab window is foreground, so Chrome rebuilds the renderer tree.
Or detect an application window hosting a Chrome/WebView renderer with an empty subtree and force a re-attach before returning the dump.
Notes
Intermittent for a single dump (the initial connection occasionally lands while the tree is up), but reliably breaks a polling client — the common case for UI automation.
Observable verified on API 36; the same mechanism explains reports appearing after the mobilewright 0.0.53 → 0.0.58 bump, which crossed mobilecli 1.0.0 → 1.0.1.
Environment
google_apissystem image, API 36 (Android 16)Summary
Since #334 ("dump ui via persistent devicekit server on android") made Android
dump uireuse a single persistentDeviceKitServerUiAutomation for the whole session, the web form fields inside a Chrome Custom Tab (e.g. the<input>s of a hosted OAuth login) frequently never appear indump ui. The Custom Tab's application window is dumped, but Chrome's renderer (web) accessibility nodes inside it are not populated.The miss is sticky: because every dump in a session shares one UiAutomation, a client that polls for an element (e.g. a 30s locator wait in a UI-automation framework) never recovers — every poll reuses the same stale connection.
Root cause (from the code)
Chromium builds a Custom Tab's renderer accessibility tree when a fresh accessibility client connects.
dump uispawned a fresh one-shotViewTreeDumpinstrumentation per call — a new UiAutomation (fresh a11y client) each dump — so Chrome (re)built the web tree, and a repeated/polling dump would eventually catch it.DeviceKitServerUiAutomation, established once (typically before the Custom Tab's web content loads) and reused for every subsequent dump. With no new a11y client, Chrome never rebuilds the web tree — and because all dumps share that one connection, polling can't recover it.#334's "output schema verified identical" check exercised native UI only, not a WebView/Custom Tab, so this regression wasn't caught.
Reproduction
google_apis, API 36), current Chrome.mobilecli dump uion some screen A — this starts the persistentDeviceKitServer(its UiAutomation connects now).<input>fields).mobilecli dump ui(repeatedly) → the web<input>nodes are absent; only the native Custom Tab chrome + application window appear.adb shell am force-stop com.mobilenext.devicekitto drop the persistent server, thenmobilecli dump uiagain → the server relaunches with a fresh UiAutomation and the web fields can appear.Concretely: a locator that polls
dump uifor one of the form inputs times out for the entire wait window under the persistent server, but resolves when a fresh instrumentation is used.Not a fix
--full(#398) — that only un-filtersTYPE_INPUT_METHOD(soft-keyboard) windows. The Custom Tab is a normalTYPE_APPLICATIONwindow that is already dumped; the missing part is the renderer nodes inside it, which--fulldoes not affect.Workaround
Launch Chrome with
--force-renderer-accessibility(write it to/data/local/tmp/chrome-command-line; requires a rootable/userdebug image +adb root), which forces Chrome to build the renderer tree from the DOM regardless of a11y-client lifecycle. Needs root; not viable on non-rootable / Play-Store images.Suggested fixes
ViewTreeDumppath (fresh UiAutomation per dump).Notes