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
{{ message }}
Repository navigation
Android open fails with "helper could not launch the application" when am start -W reports "Status: timeout" on slow cold starts #4095
Hi! Thanks for agent-device, it's been great for our Android flows.
We're hitting an occasional open failure where the app actually launched fine.
Environment
agent-device 0.21.29 (via @e2e-dev/mobile 0.12.4). The Status: ok check in app-lifecycle is unchanged in 0.21.35 and on current main (packages/platform-android/src/app-lifecycle.ts).
COMMAND_FAILED: Android helper could not launch the application
…but the app is up and running right after.
Why (as far as I can tell)
The Android helper's open runs am start -W. When the launch takes more than ~10 s, am stops waiting and prints Status: timeout, while the launch itself keeps going. app-lifecycle treats any output that doesn't match /^Status: ok\r?$/m as a failure, so the timeout case is reported as a launch failure.
Evidence
In all 3 failures the helper output looked like this (package name replaced):
ActivityTaskManager logged the START with result code=0, and Displayed com.example.app/.MainActivity showed up 0.4–1.4 s after the helper returned the timeout. No crash or ANR.
Idea
Would it make sense to treat Status: timeout with an Activity: line as "launch was dispatched" and not fail open? Or, alternatively, keep waiting until the app is in the foreground before deciding? We plan to work around it locally with a patch that relaxes that check, but we'd much prefer an upstream fix. Does that sound reasonable, or is there a reason timeout is treated as a failure?
Triage: bug; actionable without more input from you. Confirmed on main: tryAndroidHelperLaunch in packages/platform-android/src/app-lifecycle.ts fails open on anything but Status: ok, and a unit test pins Status: timeout as a failure. am start -W stops waiting after about 10 s while the launch continues, so a slow cold start is reported as a failed launch. The intended fix: treat Status: timeout with an Activity: line for the requested package as dispatched, then require the package to reach the foreground within the open's deadline before returning ok. Thanks for the timeout and success outputs side by side.
Activity
thymikee commentedon Oct 31, 2026
Triage: bug; actionable without more input from you. Confirmed on main:
tryAndroidHelperLaunchinpackages/platform-android/src/app-lifecycle.tsfailsopenon anything butStatus: ok, and a unit test pinsStatus: timeoutas a failure.am start -Wstops waiting after about 10 s while the launch continues, so a slow cold start is reported as a failed launch. The intended fix: treatStatus: timeoutwith anActivity:line for the requested package as dispatched, then require the package to reach the foreground within the open's deadline before returning ok. Thanks for the timeout and success outputs side by side.fix(android): accept a dispatched am start timeout once the app is fo…