Skip to content

fix(app-flow): target the booted device when several simulators are booted - #120

Merged
hurali97 merged 1 commit into
callstackincubator:mainfrom
RaajYedida:fix/app-flow-device-selection
Nov 18, 2026
Merged

hurali97 merged 1 commit into
callstackincubator:mainfrom
RaajYedida:fix/app-flow-device-selection

Conversation

@RaajYedida

Copy link
Copy Markdown
Contributor

Problem

With two iOS simulators booted, an App Flow sweep fails right after the native build:

Native ios app was not installed after running the ios script. Looked for com.cope.plateset, Plateset, plateset. Installed: (none).

The build had installed the app on the simulator App Flow booted (the Metro log shows Installing on <device> and Opening on <device>). The agent-device request log for the follow-up listing shows the real failure:

"command":"apps" … "error":"2 devices match this request equally; select one explicitly."  (AMBIGUOUS_MATCH)

bootDevice boots a specific device, but listInstalledApps, ensureExpoGoInstalled (apps.install) and openAppSession (apps.open) don't name it. No session is open yet, so the daemon resolves each request by itself and finds two equal matches. listInstalledApps turned that error into [], which surfaces as the misleading "not installed" message.

Fix

  • Pass the boot result's id (udid on iOS, serial on Android) to apps.list, apps.install and the first apps.open.
  • Log a failed listing instead of silently returning an empty list.
  • Export listInstalledApps, openInstalledApp and LaunchMode so the launch path can be tested without a device.

Testing

  • New packages/core/test/app-flow-device-selection.test.ts fakes a daemon with two booted simulators, so any request without a udid throws. It fails on main and passes with this change.
  • node --test packages/core/test/app-flow-*.test.ts: 263 passing.
  • tsc --noEmit: no new errors. The same 25 pre-existing errors in packages/ui/src/tracesift-controller.ts appear on main.
  • Applied the equivalent change to the installed 0.1.183 Claude Code plugin and re-ran the sweep against an Expo Router app with a second simulator booted. The sweep got past install and launch on the intended simulator.

🤖 Generated with Claude Code

…ooted

App Flow boots a specific simulator but then lists installed apps, installs
Expo Go and opens the app without naming it. Before a session exists the
agent-device daemon resolves those requests on their own, so with a second
simulator booted they fail with AMBIGUOUS_MATCH. The listing error was
swallowed as an empty list, and the sweep stopped with "Native ios app was
not installed after running the ios script" even though the build had just
installed it on the booted device.

Pass the boot result's id as udid to apps.list, apps.install and the first
apps.open, and log a failed listing instead of hiding it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

@RaajYedida is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

@hurali97
hurali97 merged commit f882a87 into callstackincubator:main Nov 18, 2026
6 of 7 checks 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.

2 participants