feat(mobile): select a physical iPhone or Android phone by its UDID or adb serial
MI
5d ago+197+197+012345678901234567890123456789-69-69-01234567890123456789
What and why
- A configured
device(ore2e run --device) can now name a connected phone by its id: an iPhone or iPad by its UDID, an Android phone by its adb serial. Before, only a simulator UDID (8-4-4-4-12) or anemulator-<port>serial was read as an id. Any other string went to agent-device as a name, matched nothing, and two phones of the same model had no way to be told apart. - iOS: the UDID pattern in
packages/mobile/src/pool.tsnow also takes a physical device's hardware UDID (00008030-001A2B3C0E12802E) and the 40-hex-digit form from before 2018. - Android: a physical serial has no fixed shape, so a configured pool or
--devicethat isn't all emulator serials lists the devices once inprepareand binds an entry that equals a listed id as that serial. Every other entry stays a name. A failed listing is logged and keeps the old name behavior. A cancelled one endsprepare.
mobile({ platform: 'ios', device: '00008030-001A2B3C0E12802E' });
mobile({ platform: 'android', device: ['R5CT1234ABC', 'emulator-5554'] });
Issue
None.
Verified
Ran it locally: yes
- iOS, paired iPhone:
agent-device devices --platform ioslists it askind:"device"with id00008150-0015XXXXXXXXC01C(masked), and the new pattern matches that id. I didn't run a test on the phone. The runner signing it needs is unchanged here. - Android: I connected a running emulator over TCP (
adb connect 127.0.0.1:5555). agent-device lists it askind:"device"with id127.0.0.1:5555, the same shape as a phone on wireless debugging. A scratch project withdevice: '127.0.0.1:5555'opened Settings and checkeddevice.unstable_raw.deviceId.--device 127.0.0.1:5555bound the same serial.
| main | this branch |
|---|---|
ENGINE_FAILURE (launch): No device named 127.0.0.1:5555 Hint: 127.0.0.1:5555 is the id of "sdk google atv64 arm64", not its name. | ✓ passed, selection: {"platform":"android","serial":"127.0.0.1:5555"} |
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.