连USB
adb devices
adb tcpip 5555
手机与电脑连同一个wifi
adb shell ifconfig wlan0
如下:
C:\Users\haojialuo>adb shell ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr f2:62:3a:bf:9e:92 Driver icnss2
inet addr:192.168.154.125 Bcast:192.168.154.255 Mask:255.255.255.0
inet6 addr: 2409:891f:a965:8aac:b1f2:4c11:f9fb:fb7f/64 Scope: Global
inet6 addr: fe80::f062:3aff:febf:9e92/64 Scope: Link
inet6 addr: 2409:891f:a965:8aac:f062:3aff:febf:9e92/64 Scope: Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:122 errors:0 dropped:0 overruns:0 frame:0
TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:26254 TX bytes:26658
C:\Users\haojialuo>adb connect 192.168.154.125
connected to 192.168.154.125:5555
后续可断开USB使用adb命令