使用网络连接 adb 调试

来自Wiki-Orange Pi
跳转至: 导航搜索

使用网络 adb 无需 USB Typc C 接口的数据线来连接电脑和开发板,而是通过网络来通信,所以首先请确保开发板的有线或者无线网络已经连接好了,然后获取开发板的 IP 地址,后面要用到。

1) 确保 Android 系统的 service.adb.tcp.port 设置为 5555 端口号

console:/ # getprop | grep "adb.tcp"
[service.adb.tcp.port]: [5555]

2) 如果 service.adb.tcp.port 没有设置,可以使用下面的命令设置网络 adb 的端口号

console:/ # setprop service.adb.tcp.port 5555
console:/ # stop adbd
console:/ # start adbd

3) 在 Ubuntu PC 上安装 adb 工具

test@test:~$ sudo apt update
test@test:~$ sudo apt install -y adb

4) 然后在 Ubuntu PC 上连接网络 adb

test@test:~$ adb connect 192.168.1.xxx (IP 地址需要修改为开发板的 IP 地址)

daemon not running; starting now at tcp:5037
daemon started successfully
connected to 192.168.1.xxx:5555


test@test:~$ adb devices
List of devices attached
192.168.1.xxx:5555 device

5) 然后在 Ubuntu PC 上通过 adb shell 就可以登录到 android 系统了

test@test:~$ adb shell

console:/ #