AutumnBox
AutumnBox copied to clipboard
Advice: use tcp connection communicate with adb.exe instead of directly calling adb.exe
The whole ADB system has three roles,
- adb client:on PC or anywhere;
- adb server: on PC;
- adbd: on android device;
The first time we call adb.exe devices
, (here is the adb client)
it will launch a daemon process like adb -L tcp:5037 fork-server server --reply-fd 252
in background.(here is the adb server)
The daemon process open a localhost TCP connection listenning on port 5037,
and actually, the adb.exe devices
command is doing like this:
client:000chost:version
server:OKAY00040027
client:000chost:devices
server:OKAY00189TXXX7 device
Notice:there is a \t
in each line of devices results.
so, it's clear now.
Send 000chost:devices
to localhost:5037, and we could read the result to device list.
For more command,anyone could use wireshark to capture the tcp communication.
I have tried this way in the past development. Later gave up, and then left an empty folder. https://github.com/zsh2401/AutumnBox/tree/master/src/AutumnBox.Basic.Shared/ManagedAdb/SocketDriven If implemented, it will completely change the way the Autumn Box interacts with ADB
This repo heyuanjie87/adbd looks helpful for develop a adb TCP client.