Skip to content

v0.33.1: the app gets its launch arguments, and Bazel apps install - #138

Merged
bitomule merged 3 commits into
mainfrom
fix/launch-args-reach-the-app
Nov 3, 2026
Merged

bitomule merged 3 commits into
mainfrom
fix/launch-args-reach-the-app

Conversation

@bitomule

@bitomule bitomule commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Why

A large iOS app is adopting mav as the driver its verify skill uses to operate the app (Bazel build, pinned mav version). On v0.33.0 that app could not be opened through a launch recipe:

  1. mav open failed at install. A Bazel .app under bazel-out/ is read-only. simctl refuses it with An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=13):, and that is the only line the driver keeps. The retry from a writable copy only matched permission denied, so it never ran.
  2. The app's launch arguments were dropped. A line like xcrun simctl launch "$MAV_UDID" "$MAV_BUNDLE_ID" SkipConsents SkipOnboarding is routed to the simctl driver, which launched the bundle alone. LaunchSpec.Args existed but nothing filled it, and neither simctl nor idb used it. The app started without its switches and nothing said so.
  3. Once the retry worked, every run kept a 538 MB copy of the app in .mav/runs/<id>/app.tmp.

What changes

  • launchArgsAfterBundle reads the tokens after $MAV_BUNDLE_ID, expands variables like the env prefix does (single quotes stay literal), and refuses anything that needs a shell (;, |, &, <, >, $(…), backticks) with launch_args_need_shell. The trail records args=<count>, never the values.
  • The simctl driver appends spec.Args after the language arguments. The idb driver puts --udid before the bundle id, because idb hands everything after the bundle id to the app.
  • shouldRetryInstallFromWritableCopy also matches NSPOSIXErrorDomain, code=13.
  • After a successful install from the copy, the copy is removed and open reports the original bundle path, which still exists.
  • README, skills/mav/SKILL.md and CHANGELOG.md (v0.33.1).

Validation

  • make check: fmt, all tests, build.
  • The 7 new or changed tests fail with the production files from main and pass with this branch:
    • TestInstallRetriesFromAWritableCopyOnSimctlPOSIX13, TestOpenRemovesTheWritableCopyAfterInstalling
    • TestOpenCarriesTheRecipeLaunchArgumentsIntoTheApp, TestOpenRefusesLaunchArgumentsThatNeedAShell
    • TestLaunchPassesTheAppArgumentsAfterTheBundle (simctl and idb), TestLaunchCarriesTheEnvironmentAsIDBPrefixed (new argument order)
  • Live, on that app (iPhone 17 Pro, iOS 26.4): v0.33.0 failed with launch_step_failed step=install (POSIX 13). This branch opened the app in 15 s: the trail shows launch.launch driver=simctl args=3, and the app skipped consent and onboarding and came up in English. mav ui tree (axe, 27 nodes) and mav capture worked, and so did mav openURL "example://search?keywords=iphone" followed by mav ui tap down to the search results (screen=search-view-collection-view).

Not changed: TestExecStepShellDoesNotSurviveMav failed once in a full run under heavy machine load and passes alone and in make check; it does not touch this code.

@bitomule
bitomule merged commit 5829f28 into main Nov 3, 2026
1 check passed
@bitomule
bitomule deleted the fix/launch-args-reach-the-app branch November 3, 2026 11:05
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