Skip to content

adb: add serial transport support for microADB#50

Open
fangpeina wants to merge 1 commit into
spiriou:masterfrom
fangpeina:dev
Open

adb: add serial transport support for microADB#50
fangpeina wants to merge 1 commit into
spiriou:masterfrom
fangpeina:dev

Conversation

@fangpeina

@fangpeina fangpeina commented Jul 15, 2026

Copy link
Copy Markdown

Add a serial (UART) transport backend using uv_tty_t on a bidirectional serial fd configured in raw mode via termios. Reuses existing frame assembly and backpressure mechanisms. Designed for resource-constrained environments where neither network nor USB is available.

Verified on Linux Host (PTY loopback)

# 1. Build (standalone CMake)
mkdir -p build && cd build
cmake .. -DADBD_SERIAL_SERVER=ON \
         -DADBD_SERIAL_PORT="/tmp/ttyV0" \
         -DADBD_SERIAL_BAUDRATE=921600
cmake --build . -j

# 2. Create virtual serial pair
socat PTY,raw,echo=0,link=/tmp/ttyV0 PTY,raw,echo=0,link=/tmp/ttyV1 &

# 3. Bridge serial to TCP (for host adb client)
socat TCP-LISTEN:5558,reuseaddr,nodelay FILE:/tmp/ttyV1,raw &

# 4. Start adbd
./adbd

# 5. Connect from PC
adb connect localhost:5558
adb devices
adb -s localhost:5558 shell pwd
adb -s localhost:5558 shell uname -a
adb shell

Add a serial (UART) transport backend using uv_tty_t on a
bidirectional serial fd configured in raw mode via termios.
Reuses existing frame assembly and backpressure mechanisms.

Verified on Linux (PTY loopback) and NuttX (QEMU).

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
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