Debian >> Android

virtual adb device


參考資訊:
1. pwl999
2. zengjfgit
3. android-adbd-for-linux
4. linuxandroid-adb-toolusbconsole
5. how-to-fix-adb-devices-message-unauthorized-device-on-macos

使用情境:
在macOS下,透過adb連接到Ubuntu 20.04 x64(Virtualbox)

Ubuntu 20.04 (192.168.15.221)

$ sudo modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
$ sudo mkdir -p /dev/usb-ffs/adb
$ sudo mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000

$ cd
$ git clone https://github.com/kiddlu/android-adbd-for-linux
$ cd android-adbd-for-linux
$ echo "" > cross.cmake
$ vim adbd/adb.c
    int SIMPLE_AUTH = 1;

$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ ./adbd

$ netstat -l | grep 5555
    tcp        0      0 0.0.0.0:5555            0.0.0.0:*               LISTEN

macOS (建立SSH Tunnel)

$ ssh -L 127.0.0.1:5555:192.168.15.221:5555 user@192.168.15.221

macOS (連接Ubuntu adb device)

$ rm ~/.android/adbkey
$ adb kill-server
$ adb devices
    List of devices attached
    emulator-5554    device


返回上一頁