Files
Builder 0874292172 Tooling: emu.sh selects the emulator explicitly
The Pixel 8a is attached to .27 at the same time as the headless
emulator, so bare adb calls failed with
"error: more than one device/emulator". Every device-specific adb call
now gets an explicit serial.

- Add serial selection: ANDROID_SERIAL when set, else the first
  emulator-* entry from "adb devices".
- Pass -s "$SERIAL" to the adb calls in install, screenshot, status and
  stop.
- wait polls for the emulator serial instead of bare
  "adb wait-for-device", which fails at once when the Pixel 8a is
  attached, then waits with -s and accepts an optional timeout.
- Fail with a clear message, and not a raw adb error, when no emulator
  runs; screenshot also fails on an empty capture.
- Interface unchanged: start|wait|install <apk>|screenshot [out]|stop|status.

Proven on .27 with the Pixel 8a attached (USB and wireless):
install -> Success, screenshot -> 1392860 bytes from emulator-5554.
The deployed copy at ~/android/emu.sh is byte-identical to this file.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-14 14:52:37 +11:00

5.5 KiB
Executable File