-
手机开启USB调试
-
手机通过USB连接PC,且和PC连接同一个wifi
-
执行adb devices,验证PC通过USB模式成功连接手机设备
-
查看手机的设置 -> 关于手机 -> 状态信息 -> IP地址(xxx.xxx.x.x)
-
在tcpip模式下重启adb端口5555:
1)执行adb tcpip 5555
2)验证重启成功:“restarting in TCP mode port:5555” -
连接到手机IP地址:
1)执行adb connect xxx.xxx.x.x
2)验证连接成功:“connected to xxx.xxx.x.x” -
再次执行adb devices,验证是否成功使用wifi连接PC和手机
-
拔掉数据线,再次执行adb devices,验证依旧显示设备
-
Appium设置:
1)选择Automatic Server:http://localhost:4723
2)在 DesiredCapabilities中,设置deviceName值为xxx.xx.x.x:5555,其他不变 -
若要断开连接:
1)执行adb disconnect xxx.xx.x.x
14. 通过WiFi的形式完成PC和Android设备的连接
于 2021-07-09 23:41:14 首次发布