fix(android): keep a timed-out target probe from failing discovery of other devices

Merged
TH
7d ago
+115-1

Summary

Android discovery probes every listed emulator's target (getprop, has-feature, pm list features). A timeout on one busy emulator rejected the whole discovery, so it failed an open for a different device.

A device whose target probe times out (typed adbFailure: 'timeout') now stays listed with an unknown target. Unknown reads as mobile in selection. Discovery emits one warn diagnostic, android_inventory_target_probe_failed, with the serial. The requested --serial, other failures, and request aborts still fail discovery, so a selected device never runs with a demoted target.

Two files changed: packages/platform-android/src/inventory.ts and its test. No new flags or modes.

Fixes #4765

Before / after

  • Before: a fake adb that times out pm list features for emulator-5554 makes discovery reject, so emulator-5556 is unreachable.
  • After: both devices are listed, emulator-5556 has target mobile, and a diagnostic names the slow device.

Validation

  • pnpm vitest run packages/platform-android/src/inventory.test.ts: the new regression test fails on base c37bb95630 source (rejects with adb timed out after 10000ms). It passes at head 7a4ff0289d (19/19).
  • Further tests check that an aborted request and a timed-out requested serial still reject.
  • pnpm typecheck and pnpm format pass locally.
  • CI owns full validation. No device run: the change is inventory logic covered by a fake adb.
  • Unverified: live behavior on a loaded emulator host.

🤖 Generated with Claude Code


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.