fix(ios): report devices CoreDevice cannot reach as not booted

Merged
GR
1d ago
+54-2

Summary

The devicectl inventory marked every paired device as booted. A paired iPhone that was unplugged and off the network was listed as booted: true, and boot succeeded on it. The app launch was the first command to fail, with CoreDeviceError 4016.

  • mapDevicectlAppleDevice lists an unavailable tunnel state as booted: false. Both call sites use isCoreDeviceReachable, which ignores case and non-string values.
  • ensureCoreDeviceReady refuses unavailable as not_ready with details.tunnelState. connected, disconnected (CoreDevice opens tunnels on demand), and an absent state still pass.
  • The physical-device help and installation.md describe this. The help sentence is on the existing "connected" line because cli-help.ts is at the 1,000-line limit.

7 files, no scope expansion. Moving off devicectl's deprecated connectionProperties is a separate change.

Fixes #4209

Validation

Base 035c2b6ca, head 73c49187d.

  • pnpm check:affected --run --head 73c49187d passed (exactCommit: true).
  • The new unit tests fail on base.
  • Live, on a paired iPhone whose tunnel state is unavailable, with agent-device-repro@ios-unavailable-device:
    • Base and 0.21.36: booted: true, boot succeeds, ./repro.sh exits 1.
    • Head: booted: false, boot fails with not_ready/unavailable, ./repro.sh exits 0. Booting a simulator still works.
  • CI owns the device lanes.
  • Risks:
    • The connected and disconnected paths are covered by unit tests only. No reachable device was available.