Skip to content

fix(ios): bind Safari as the target app for simulator web-URL opens - #2761

Merged
thymikee merged 1 commit into
mainfrom
fix/ios-sim-web-url-safari-bundle
Sep 22, 2026
Merged

thymikee merged 1 commit into
mainfrom
fix/ios-sim-web-url-safari-bundle

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Opening a web URL on an iOS simulator (open https://…) bound no app to the session, so the next interaction had no target. The runner then hit missing_app_bundle, activated its own host app, and wedged until the 30s main-thread watchdog (main thread execution timed out), while the activation bounced Safari to Springboard. Physical-device opens already fall back to com.apple.mobilesafari; the simulator branch did not.

resolveIosBundleIdForOpen now returns IOS_SAFARI_BUNDLE_ID for a simulator web URL, mirroring the device branch. simctl openurl opens the URL in Safari regardless, so this only sets the session target app for later interactions; it does not change launch mechanics.

Touched 3 files (1 source, 2 tests). No public-surface change; behavior parity with the device path.

agent-device open https://apex.callstack.com --platform ios --udid <sim>
agent-device scroll down 0.3 --settle   # previously timed out

Validation

Commit 21640b8de.

  • pnpm check:affected --run: all runnable checks passed (292 files / 1761 tests).
  • New regression test: simulator web-URL open records com.apple.mobilesafari (fails before the fix); the prior undefined expectation is replaced.
  • Live iPhone Duo (iOS 27.1) run of the changed path, non-foreground (foreground resolution is a separate path): open https://apex.callstack.com reported App: com.apple.mobilesafari; scroll down, fold half-open → fold open, and scroll bottom all succeeded and reached the footer. The previously-wedging scroll settled in ~1.7s.

Unresolved risk: an https URL claimed by a universal-link app instead of Safari is still assumed to be Safari — unchanged from the existing device web-open behavior.

Runner-side fail-fast for interaction commands with no bundle is left as a separate follow-up to keep this PR scoped to the daemon.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.80 MB 4.80 MB +30 B
Package (unpacked) 4.79 MB 4.79 MB +30 B
Package (download) 1.43 MB 1.43 MB -5 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.2 ms 21.9 ms -0.3 ms
CLI --help 60.9 ms 61.4 ms +0.5 ms

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 21640b8. The fix looks right: a simulator web-URL open now binds com.apple.mobilesafari like the device path, and the reported iPhone Duo run covers the changed path.

Not blocking: the body says launch mechanics do not change, but the bundle id now also turns on runner prewarm and the bridge-observation settle in open-policy.ts for the open call itself, and the simulator branch does not keep an existing app context the way the device branch does; both are worth a line in the body.

The Coverage failure is the stale contact-sheet approval row in eager-closure-budgets, which #2757 removes, so it is not related to this diff. Smoke Tests is still running.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 22, 2026
@thymikee
thymikee merged commit 0787413 into main Sep 22, 2026
17 of 18 checks passed
@thymikee
thymikee deleted the fix/ios-sim-web-url-safari-bundle branch September 22, 2026 12:38
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-22 12:38 UTC

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.

1 participant