使用adb命令连接WiFi进行无线调试
1.用USB连接手机
2.运行 adb devices,测试是否连桐岩接成功,能出现设备列表即可;
3.打开命令输入
adb tcpip 5555
结果
adb tcpip 5555;restarting in TCP mode port: 5555
4.查看手机ip
adb shell ifconfig wlan0
结果
wlan0 Link encap:UNSPEC inet addr:192.168.50.141 Bcast:192.168.50.255 Mask:255.255.255.0 inet6 addr: fe80::7a62:56ff:fee5:76d0/64 Scope: Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3454241 errors:0 dropped:23 overruns:0 frame:0 TX packets:2524887 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:152319933 TX bytes:535345072
连接wifi
adb connect 192.168.50.141
结果
connected to 192.168.50.141:5555
然野轮弊后就可以进行wifi调试了
模拟器或者电视盒子在已知adb调试端口的情况下可以直接通过adb connect xxx.xxx.xxx.xxx:xxxx(模拟器或盒子的IP:adb调试端口),
通过adb devices看到已经连接的颂族设备
常见模拟器adb端口如下图所示: