c-x-a
【实施方法】
手机和电脑同时连接到同一个wifi上
1、开启远程adb
#开启远端adb,这一步需要手机通过USB连接到电脑
adb tcpip 5555
#结果如下:restarting in TCP mode port: 5555
#然后断开USB
adb connect 192.168.3.2:5555 
#其中192.168.3.2是手机的局域网IP地址
adb devices
#确认可以看到设备信息

2、通过adb命令启动uiautomator2的agent

db shell /data/local/tmp/atx-agent -d
3、通过uiautomator2脚本连接手机执行用例

import uiautomator2 as u2
d = u2.connect_wifi(\'192.168.3.2\')
print(d.info)
发现可以成功执行

PS:因为有些操作系统上uiautomator2的agent无法自动拉起,所以需要手动通过adb命令拉起

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2022-02-22
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-12-18
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-07-08
  • 2022-12-23
  • 2021-11-10
  • 2021-12-19
相关资源
相似解决方案