Skip to content

fix(aws): defer Android app launch until open - #2512

Merged
thymikee merged 1 commit into
callstack:mainfrom
dennisimoo:fix/aws-device-farm-deferred-app-launch
Sep 12, 2026
Merged

fix(aws): defer Android app launch until open#2512
thymikee merged 1 commit into
callstack:mainfrom
dennisimoo:fix/aws-device-farm-deferred-app-launch

Conversation

@dennisimoo

Copy link
Copy Markdown
Contributor

Summary

AWS Device Farm Android sessions now create Appium with appium:autoLaunch=false by default. The existing open lifecycle still activates the requested package after allocation, but first-run system activities can no longer make WebDriver session creation fail before agent-device gains control.

This changes 2 files (+15/-1). Other providers and iOS behavior are unchanged; explicit internal capability overrides still win.

Validation

Tested commit fdab96c27afe40bcd5432ed110ffc6353aee4686:

  • pnpm check:affected --run — all runnable checks passed
  • 102 related test files / 588 tests passed
  • Regression test failed before the implementation (autoLaunch was undefined) and passes after it

GitHub remains authoritative for the listed live/device lanes.

Copilot AI lite review requested due to automatic review settings September 12, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Add a regression test verifying that an explicit appium:autoLaunch: true override wins.

Pull request overview

Updates AWS Device Farm Android sessions to defer app launch until open.

Changes:

  • Sets Android appium:autoLaunch to false.
  • Preserves explicit capability overrides.
  • Adds regression coverage.
File summaries
File Summary
packages/provider-webdriver/src/aws-device-farm.ts Applies the Android deferred-launch default.
packages/provider-webdriver/src/aws-device-farm.test.ts Tests the default behavior; add coverage confirming explicit true overrides remain effective.
Review details

Suppressed comments (1)

packages/provider-webdriver/src/aws-device-farm.test.ts:138

  • This regression test only exercises the default path. The merge order on lines 248–250 is the part that guarantees an explicitly configured appium:autoLaunch value still wins, so add a case that passes webdriverCapabilities: { 'appium:autoLaunch': true } and asserts true; otherwise a future change that reverses the spreads would silently break the documented override behavior.
  assert.equal(prepared.webdriverCapabilities['appium:autoLaunch'], false);
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thymikee

Copy link
Copy Markdown
Member

No code findings at fdab96c. The Android default reaches WebDriver session creation, explicit overrides still win, and open retains the later app activation. Before this is ready, please provide a live AWS Android run that allocates a session with autoLaunch=false, opens the requested package successfully, and cleans up the session; the capability-construction test does not prove that provider lifecycle. There are no conflicts, and GitHub currently reports no checks for this head.

@dennisimoo

Copy link
Copy Markdown
Contributor Author

Live AWS Android verification completed against commit fdab96c27afe40bcd5432ed110ffc6353aee4686.

Device/app:

  • AWS Device Farm Xiaomi Redmi Note 13+, Android 15
  • Uploaded APK: deliverd-assessment-v4-ranks301-400.apk
  • Installed package/activity: gr.itworx.funship2/.MainActivity

Lifecycle evidence from the provider Appium log:

  • POST /session included "appium:autoLaunch": false
  • UiAutomator2 created the session successfully; POST /session returned 200 in 20.693s
  • The first explicit open gr.itworx.funship2 --foreground issued activate_app, resolved .MainActivity, ran the launcher intent, and returned 200
  • A second open ... --relaunch terminated the package successfully, issued activate_app again, and returned 200
  • close issued DELETE /session, which returned 200
  • AWS remote-access session finalized as COMPLETED / PASSED
  • Provider Appium log, device logs, and video are all available

AWS session ARN (no credential material):
arn:aws:devicefarm:us-west-2:928535088750:session:f75c9306-5915-4320-b143-b547fb5834b2/957180bd-3e3d-44c1-9074-1d70357032e2/00000

The device snapshot returned to the Xiaomi launcher after activation, but the Appium/ADB trace confirms that the requested installed package and its main activity were explicitly launched; importantly, session creation no longer waits for or is destroyed by that app lifecycle.

@thymikee

Copy link
Copy Markdown
Member

The reported AWS run at fdab96c closes the provider-lifecycle validation gap: session creation used autoLaunch=false, explicit open and relaunch activated the installed package, and both WebDriver and AWS cleanup completed. The return to the launcher does not establish that the app stayed foregrounded, but the trace supports this session-creation fix. Code review remains clean and there are no conflicts; ready for human review. GitHub still reports no checks, so merge readiness is not established.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 12, 2026
@thymikee
thymikee merged commit 49fbaf6 into callstack:main Sep 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants