Skip to content

Fix physical-device openURL argument ordering - #147

Merged
bitomule merged 1 commit into
mainfrom
worktree-t-mav-device-openurl-missing-target
Nov 14, 2026
Merged

bitomule merged 1 commit into
mainfrom
worktree-t-mav-device-openurl-missing-target

Conversation

@bitomule

Copy link
Copy Markdown
Owner

With an explicitly selected physical device, mav openURL failed with Missing expected argument '--device …'. The selected UDID reached CoreDevice correctly, but its launch command put --device and --json-output after the app bundle identifier, where devicectl treats them as application arguments.

Keep tool options before the app bundle identifier and preserve the separate application argument tail. Continue using the supported --payload-url option without rewriting the URL. This also fixes the shared physical-device launch path. Document physical-device URL delivery in the README and MAV skill.

Diagnosis and validation

  • Reproduced on freshly fetched main ef55d28 (also tag v0.35.0) and installed MAV 0.35.0. The command emitted by main fails with exit 64 on CoreDevice 651.13.5 using a synthetic device identifier, before device lookup.
  • Driver regression checks option ordering, exact URL bytes (query, percent escapes, plus signs and fragment), and preservation of application arguments/environment. CLI regression selects an environment target over a different configured device and covers simulator and Mac routing.
  • Before the fix, go test ./internal/mav/drivers/coredevice -run 'TestOpenURL|TestLaunchReads' -v failed both TestOpenURLPassesPayloadToConfiguredApp and TestLaunchReadsJSONPIDAndPreservesAppArgumentsAndEnvironment: the bundle preceded --device. The CLI device subtest also failed with the same incorrect argv order. With the fix, all three regression tests and the simulator/Mac subtests pass.
  • make check passed: formatting, all tests (main package: 81.488s), and compilation.
  • Physical-device comparison using Safari and https://example.com/?mav_probe=a%20b+c&next=x%26y%3Dz#part%201: installed MAV returns fail code=open_url_failed with the missing-device error; the locally built fixed binary returns ok cmd=openURL driver=coredevice target_kind=device target_source=env and the unchanged URL. This verifies CoreDevice accepted delivery; custom-app handling of a URL is covered by synthetic argv tests, not a private app UI assertion.

Public content review: reviewed the English README, skill additions, tests and PR text. All published examples are synthetic; no device identifiers or personal paths from the physical-device probe are included. No global installation or release is part of this change.

@bitomule
bitomule merged commit 29550ec into main Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant