Skip to content

iOS physical device: focused React Native overlay input can leave XCTest-backed commands timing out while screenshots/taps still work #1138

Description

@billsbooth

Environment

  • agent-device: 0.18.3 (npx -y agent-device --version)
  • Host OS: macOS 26.5.2 (25F84)
  • Xcode: 26.6 (17F113)
  • Node: v26.4.0
  • npm: 11.17.0
  • Target: physical iPhone connected to the Mac
  • App type: Expo React Native development-client app
  • UI shape involved: focused text input inside a bottom-sheet / overlay style surface, plus a related custom numeric keypad surface with a decorative infinite Reanimated animation

Description

We are seeing intermittent but repeatable iOS physical-device automation stalls after a focused input inside a React Native bottom-sheet / overlay is active.

The app remains visibly responsive:

  • agent-device screenshot still works.
  • Raw coordinate presses still work.
  • Pressing visible keyboard keys by coordinate can enter text.
  • Pressing visible custom keypad keys by coordinate can update the amount display.

But XCTest-backed commands can start timing out in the same state:

  • snapshot -i
  • type
  • fill
  • keyboard dismiss
  • drag/back-style recovery attempts

The observed error class is main thread execution timed out.

This feels like XCTest quiescence/idleness getting stuck after the overlay/input/keyboard state becomes active, rather than the app being frozen. One related surface also contains a decorative infinite Reanimated caret animation, which may make the problem easier to trigger, but the focused text-input overlay case can happen separately from that caret.

I saw #1105 and #1107, which sound adjacent: iOS capture can stall while the app is still healthy, and the merged fix bounds capture stalls / preserves sessions. This report is specifically from a physical iPhone workflow on the latest published npm release (0.18.3), where #1107 does not appear to be released yet. If #1107 is expected to cover this once released, confirmation would be helpful.

Reproducible Demo

I do not have a minimal public repo yet, but the minimal shape should be:

  1. Create an Expo React Native dev-client app.
  2. Add a screen with a bottom-sheet / overlay style component.
  3. Put a text input in that overlay and focus it so the iOS keyboard is visible.
  4. Optionally add a second overlay with a custom numeric keypad and a nonessential infinite Reanimated animation, such as a blinking caret.
  5. Launch on a physical iPhone through agent-device.
  6. Open the overlay and focus the input.
  7. Run agent-device snapshot -i, type, fill, and keyboard dismiss against the focused state.

Expected:

  • Snapshot/text-entry/keyboard commands either work, or fail quickly with actionable state while preserving the session.

Actual:

  • Screenshots and coordinate taps still show the app is alive, but XCTest-backed commands can time out with main thread execution timed out.

Current workaround:

  • Avoid repeated idle-dependent commands once the timeout appears.
  • Capture screenshot evidence as visual truth.
  • Press visible keyboard/keypad coordinates directly only to prove user-visible behavior.

Question:

  • Is there a recommended agent-device pattern for focused React Native overlays on physical iOS devices, especially where XCTest waits for app idle but screenshots/taps still work?
  • Should we expect fix: bound iOS capture stalls and make runner recovery session-preserving (#1105) #1107 to address this after the next npm release?
  • Is there a way for agent-device to expose a faster "XCTest channel busy / app still alive" diagnostic or direct hint to use screenshots/coordinate presses in this state?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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