fix(mobile): check iOS simulator build and bundleId in doctor
MA
10h ago+811+811+012345678901234567890123456789-8-8-0123456789
What
e2e doctor reads the Info.plist of an iOS app.appPath .app bundle, and app-path fails when:
- the bundle is a device build (
iPhoneOS,AppleTVOS,XROS) for a target that drives simulators. Any*Simulatorplatform counts as a simulator build, tvOS and visionOS included, and the message names the SDK to build with (-sdk iphonesimulator,appletvsimulator, orxrsimulator). CFBundleIdentifier,CFBundleDisplayName, andCFBundleNameall differ fromapp.bundleId, when both sides are present.
Why
Pointing app.appPath at a device build or a bundle with another identifier passed app-path as long as the directory existed, and the run failed later with a confusing install or launch error.
How it works
packages/mobile/src/plist.tsadds a small XML and binary (bplist00) property-list parser (parsePlistDict), with no dependency and noplutilsubprocess, so doctor works off macOS too.buildCheckreadsInfo.plistfor an iOS.appand fails a bundle whoseCFBundleSupportedPlatformsnames no*Simulatorplatform, using the device platform it names to pick the SDK in the message (packages/mobile/src/doctor.ts:116,:156).- Before failing,
classifyIosTargetasks agent-device's inventory (devices.list) whether the target drives simulators. The inventory'skindis the only source: configured devices must all be listed, and with none configured the booted ones decide, or a simulator is booted. One simulator in the pool makes it a simulator target, since the build has to install there too. A device the inventory does not list, or an inventory that cannot be read, leaves the build trusted. An abort while reading it stops doctor (doctor.ts:80). - The identifier check compares
app.bundleIdwith the bundle id, display name, and bundle name. A missing, unreadable, or malformedInfo.plistpasses, including one nested past the parser's stack, so doctor never fails on a bundle it cannot read. docs/reference/cli.mdxdescribes the check.
Issue
Fixes #2016
Verified
Ran it locally: yes - unit level, with a scripted agent-device client; no simulator run.
pnpm --filter @e2e-dev/mobile test: 721 of 721 pass. 21 are inpackages/mobile/tests/unit/doctor.test.ts, covering XML and binary plists, theiPhoneOSandAppleTVOSdevice builds, a tvOS simulator build, a mismatched identifier, physical device targets, a pool mixing a simulator and a device, an unlisted device, a cancelled doctor (the cancel must come from the inventory read), and missing, malformed, or too deeply nested plists.- The binary-format test reads
tests/fixtures/plist/tvos-simulator-utf16.plist, written byplutil -convert binary1(UTF-16 strings, nested arrays and dicts), not by the test's own encoder.plutil -convert jsonof the fixture:
{"MinimumOSVersion":"26.0","CFBundleIdentifier":"dev.e2e.café","CFBundleName":"Cafe","CFBundleDisplayName":"Café ✓ Résumé","UIDeviceFamily":[3],"CFBundleSupportedPlatforms":["AppleTVSimulator"],"CFBundleIcons":{"CFBundlePrimaryIcon":{"CFBundleIconFiles":["AppIcon60x60",["nested"]]}}}
- Typecheck, lint, and
pnpm docs:checkare clean.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.
Summary by CodeRabbit
- New Features
- The iOS simulator app-bundle check now verifies that the bundle identifier, display name, or bundle name matches the configured app identifier.
- The check reports when a device-built app bundle is used for a simulator target and provides guidance specific to the simulator SDK. tvOS and visionOS simulator builds are also recognized.
- Missing or unreadable app metadata does not cause the check to fail.
- Documentation
- Updated the
e2e doctorreference to describe the iOS app-bundle checks and simulator-target behavior.
- Updated the