在使用adb调试安卓设备过程当中,要使用usb线才能进行调试;
前提:
若计算机和需要调试的安卓设备都支持WiFi网络,便可以使用WiFi 进行adb调试,不再受usb接口或线的束缚
步骤:
1. usb线连接安卓设备到计算机;
2. 在终端依次输入命令:
C:\Users\Administrator>adb usb
restarting in USB mode
C:\Users\Administrator>adb tcpip 5555
restarting in TCP mode port: 5555
C:\Users\Administrator>adb shell ifconfig wlan0
wlan0 Link encap:UNSPEC Driver icnss2
inet addr:10.14.85.38 Bcast:10.14.85.255 Mask:255.255.255.0
inet6 addr: fe80::a891:3383:5390:2df7/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:77 errors:0 dropped:0 overruns:0 frame:0
TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:22139 TX bytes:15598
C:\Users\Administrator>adb connect 10.14.85.38
第四条命令中connect的IP地址是从第三条命令中得到的
3. 提示connect后,断开usb线,即可不使用usb线条件下进行adb调试。
注意:需要保证计算机和安卓设备在同一WiFi网络环境下