adb (Android targets)¶
The adb channel drives a phone, tablet, or Android board that adb can
reach: console (adb shell), screen (adb exec-out screencap), and input
(adb shell input), over one transport.
panio runs the host's adb binary itself (core CLI, cli/src/adb.rs; no
helper). The device is named by its adb -s <serial> id and bound to the
control host it is plugged into, reached locally or over SSH
(dispatch).
Power: use the power hooks:
panio power set -t pixel --off-cmd "adb -s <id> reboot -p" --cycle-cmd "adb -s <id> reboot".
Setup¶
# Discover attached devices (their serials), locally or on a control host
panio adb devices
panio adb devices -H bench1 # over SSH on a remote control host
# Or let panio propose a whole target block from discovered hardware —
# `adb` appears alongside the serial/video/netboot it finds (authorized
# devices only). Review and paste it into the lab; panio never writes it.
panio configure pixel -H bench1
panio discover # raw inventory of the local host
# Bind a device to a target in the lab file
panio target add pixel
panio adb set -t pixel --serial 33271JEGR02033
# Sole attached device? Omit --serial.
panio adb set -t pixel
# Device on a remote control host (adb runs there; reached over SSH)
panio adb set -t pixel --serial 33271JEGR02033 --host bench1
# Pin a non-PATH adb binary
panio adb set -t pixel --adb /opt/platform-tools/adb
# Remove the channel
panio adb rm -t pixel
Prerequisite: authorize the device first (USB debugging on, host key
accepted); panio does not pair. adb devices must show device, not
unauthorized/offline.
panio doctor runs adb get-state on the channel's host and reports:
okwhen the device answers in thedevicestate;MISSINGwhen it does not;- "adb not installed" when there is no
adbonPATH.
Commands¶
# Console
panio adb shell pixel # interactive `adb shell` (PTY)
panio adb run -t pixel getprop ro.product.model # one-shot, captured
panio adb run -t pixel -- logcat -d -t 50 # `--` guards leading flags
# Screen
panio adb screencap pixel -o shot.png # PNG to a file — always this machine's
panio adb screencap pixel -o - > shot.png # PNG to stdout
# Input
panio adb input -t pixel keyevent KEYCODE_HOME
panio adb input -t pixel text "hello world"
panio adb input -t pixel tap 540 1200
panio adb input -t pixel swipe 540 1800 540 600 200
# Discovery (no configured channel required)
panio adb devices [-H <host>]
panio adb show pixel # config + live device state
runis the one-shot: it captures output and returns the command's exit code.runandinputname the target with-t/--target, not a positional. Put-tfirst, and--before any argument that starts with a dash.
screencap uses adb exec-out screencap -p. -o <path> is always on
this machine, even for a remote channel, and is replaced only when the
capture succeeds. -o - (the default) writes to stdout.
Lab file shape¶
[targets.pixel.adb]
serial = "33271JEGR02033" # adb -s id; omit for the sole attached device
# adb = "/opt/platform-tools/adb" # override the adb binary (default: adb on PATH)
# host = "bench1" # control host the device is plugged into
Relationship to the other channels¶
| Capability | Wired bring-up channel | adb equivalent |
|---|---|---|
| Console (interactive) | serial connect |
adb shell |
| Console (one-shot/agent) | serial send / serial log |
adb run |
| Screen | video shot (UVC capture) |
adb screencap |
| Input | hid send (USB HID rig) |
adb input |
| Reboot / power | power hooks, DTR |
power hooks (adb reboot) |
adb sees only running Android, not the bootloader or firmware. To watch those
too, give the target both an adb channel and the wired channels.
For firmware that accepts USB fastboot downloads into RAM, use the
guarded staging workflow with an external client and runner.