Skip to content

Snapshot on Android RN New Architecture (Fabric) returns only the system window, never the app content #850

Description

@rpgdev

Summary

On an Android React Native New-Architecture (Fabric) app, agent-device snapshot never returns the app's view tree — it returns only the system status/navigation-bar window. Plain adb shell uiautomator dump captures the full app tree on the exact same screens, so the device/app is fully introspectable — agent-device's helper just doesn't get it.

A second, independent problem found in the same session — the snapshot-helper instrumentation being left running and locking out the single Android UiAutomation connection — is filed separately (see linked issue).

Environment

Reproduced on two different devices spanning Android 10 → 14 and two OEM skins (LG and Xiaomi), so this is not an old-device / OS-version / OEM-skin artifact:

  • agent-device: 0.17.6 (latest 0.17.7)
  • OS / Node: Fedora Linux 43, Node v22.22.2
  • Android SDK / adb: platform-tools, adb 1.0.41
  • Device A: LG V35 (LM-V350N), Android 10 (SDK 29), LG UX, USB
  • Device B: POCO 23049PCD8G (Xiaomi marble), Android 14 (SDK 34), HyperOS, USB
  • App: Expo SDK 56, React Native 0.85.3, newArchEnabled=true (Fabric), Hermes, reanimated 4.3.1 (identical app on both)

Problem — snapshot returns only the system window (no app content) on Fabric

On Device A (Android 10, LG):

$ agent-device snapshot -i --platform android
Snapshot: 7 nodes
@e1 [group]
@e2 [image] "Hide navigation bar"
@e3 [image] "Back"
@e4 [group]
@e5 [image] "Home"
@e6 [image] "Overview"
@e7 [group]

snapshot (full) and snapshot --force-full return ~17 nodes — still only system windows (nav bar + an OEM "Tools" overlay), never the app's content.

On Device B (Android 14, Xiaomi/POCO) the same failure occurs, with a slightly different shape:

$ agent-device snapshot -i --platform android
Snapshot: 0 nodes
Interactive snapshot is empty after filtering 44 raw Android nodes.

$ agent-device snapshot --platform android          # and --force-full: identical
Snapshot: 11 nodes        # status-bar icons (wifi/signal/battery/clock) + a Xiaomi "Tools" overlay

i.e. interactive returns 0 (it saw 44 raw nodes and filtered them all out); full returns only the system status bar + OEM overlay — never app content.

For comparison, on the same foreground screen, plain uiautomator returns the full RN tree:

$ adb shell uiautomator dump /sdcard/x.xml      # 19,185 bytes, 58 nodes
UI hierchary dumped to: /sdcard/x.xml
# contains the real app view tree — screen title, section/list headers, button labels,
# bottom-tab labels, etc. (text/content-desc/resource-id/bounds all present)

(Verified across multiple screens: 48 / 58 / 76 app nodes via raw uiautomator dump on Device A; 58 and 61 on Device B.)

Likely cause: the helper is invoked with a very tight idle gate — observed in ps: am instrument -w -e waitForIdleTimeoutMs 500 -e waitForIdleQuietMs 100 -e timeoutMs … SnapshotInstrumentation (matches the android-snapshot-helper README). A Fabric app's accessibility event stream rarely goes quiet for 100 ms within a 500 ms window, so the helper times out and appears to fall back to a non-app window. Raw uiautomator dump uses Android's default (more lenient) idle wait and succeeds on the same screen, which suggests the issue is the helper's idle gate / its window selection on timeout — not accessibility access itself. These idle parameters don't appear to be configurable from the snapshot CLI (--timeout maps to the overall command timeout, not waitForIdleQuietMs).

Minimal reproduction

  1. Build/run any RN 0.85 New-Arch (Fabric) Android app; bring a content screen to the foreground.
  2. adb shell uiautomator dump /sdcard/x.xml → full app tree (baseline works). (On Android 11+, scoped storage may require /data/local/tmp/x.xml.)
  3. agent-device snapshot -i --platform android → only system-window nodes; no app content.

Impact

New Architecture is the default in RN 0.85, so snapshot (and the snapshot → @ref → click flow built on it) is effectively unusable on current RN apps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions