Repository navigation
fix: reconnect to the Dart VM after mobile: launchApp - #936
Conversation
activateApp relaunched the iOS app without the session's processArguments, so the --vm-service-port / --disable-service-auth-codes flags injected for dartVmServicePort were lost and the reconnect fell back to a closed port. Pass them to XCUITest's activateApp, which launches via mobileLaunchApp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Did you try out
https://github.com/appium/appium-flutter-driver#several-ways-to-start-an-application |
|
Yes, I looked at it, but it doesn't cover this case. Checked against the instrument-service path it uses:
Happy to add a README note pointing real-device users to |
|
Thank you. Then, would https://appium.github.io/appium-xcuitest-driver/latest/reference/execute-methods/#mobile-launchapp help then? appium-flutter-driver/driver/lib/driver.ts Line 238 in e13a971 |
Per review, leave activateApp as it was and let mobile: launchApp take the same cross-context path as mobile: activateApp: proxy it to XCUITest from any context and then reconnect to the Dart VM, honoring skipAttachObservatoryUrl. Before this, it failed with "Command not supported" in the FLUTTER context and left the socket pointing at the old process when called from NATIVE_APP. Document relaunching with launch arguments (e.g. the dartVmServicePort flags) through mobile:launchApp in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
That makes sense — thanks for the pointer. I've reworked the PR along those lines: |
…he app" This reverts commit d07a9ee. Upstream chose to relaunch with arguments through mobile: launchApp instead (appium#936), so activateApp keeps its upstream behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
activate_app relaunches without launch arguments, so the engine would bind a random port the driver cannot discover in this environment. Use mobile: launchApp (reconnects since appium#936) with the same arguments, and update the processArguments comment: appium#933 fixed the flag forwarding; the sample app still needs --observatory-port because of its old engine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
mobile: launchAppis the XCUITest way to relaunch an app witharguments/environment(e.g. the
--vm-service-port/--disable-service-auth-codesflags thatappium:dartVmServicePortrelies on since #933), but it is not usable through this driver:
FLUTTERcontext it is not proxied and ends up asCommand not supported.NATIVE_APPthe app relaunches, but the Dart VM socket keeps pointing at the old process.Fix
mobile: launchAppnow takes the same cross-context path asmobile: activateApp: it is proxied toXCUITest from any context and then
reConnectFlutterDriverruns, honoringskipAttachObservatoryUrl.activateAppis unchanged.The README lists
mobile:launchAppamong the cross-context commands, with an example of relaunchingwith the
dartVmServicePortflags.Tests
Added
driver/test/mobile-launch-app.test.mjs, which callsFlutterDriver#executeCommandin theFLUTTERcontext and asserts thatmobile: launchAppis forwarded to the proxy driver and followed bya reconnect (or not, with
skipAttachObservatoryUrl). Both cases fail on the currentmainand passwith this change.
🤖 Generated with Claude Code