Skip to content

automate_observation: add --serial to target specific devices - #33

Merged
billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/support-multi-device
Sep 29, 2026
Merged

billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/support-multi-device

Conversation

@billy-lau

Copy link
Copy Markdown
Member

Add a repeatable -s/--serial flag so that callers (and the upcoming web UI helper) can choose which connected devices to observe instead of always iterating over every device listed by adb devices.

  • Selected devices are processed in the order given; duplicates are ignored.
  • A requested serial that is not connected is logged, reported as FAILED in the final summary with a dedicated message, and causes exit code 1. Remaining requested devices are still observed.
  • The "More than 1 device connected!" warning is only emitted when --serial is not used.
  • Without --serial, behaviour, log text and exit codes are unchanged.
  • This also applies when no device is connected at all (or adb devices fails): with --serial, the "No devices connected!" early return is skipped so the requested serials are reported as FAILED.

Selection logic lives in a new pure helper, select_target_devices(), covered by unit tests alongside end-to-end main() tests.

Change-Id: I9f3fc21eb1b85b9fda4fa0a5c5b4da95322f3091

Add a repeatable -s/--serial flag so that callers (and the upcoming
web UI helper) can choose which connected devices to observe instead
of always iterating over every device listed by `adb devices`.

- Selected devices are processed in the order given; duplicates are
  ignored.
- A requested serial that is not connected is logged, reported as
  FAILED in the final summary with a dedicated message, and causes
  exit code 1. Remaining requested devices are still observed.
- The "More than 1 device connected!" warning is only emitted when
  --serial is not used.
- Without --serial, behaviour, log text and exit codes are unchanged.
- This also applies when no device is connected at all (or `adb
  devices` fails): with --serial, the "No devices connected!" early
  return is skipped so the requested serials are reported as FAILED.

Selection logic lives in a new pure helper, select_target_devices(),
covered by unit tests alongside end-to-end main() tests.

Change-Id: I9f3fc21eb1b85b9fda4fa0a5c5b4da95322f3091
@billy-lau
billy-lau merged commit 8658fd5 into android:main Sep 29, 2026
7 checks passed
@billy-lau
billy-lau deleted the uraniborg/support-multi-device branch September 30, 2026 03:52
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.

1 participant