tidevice工具实现iOS自动化

1.安装tidevice(python3.7以上版本)

1)安装tidevice

pip install -U tidevice或者 pip3 install -U "tidevice[openssl]" 

2)查看版本号

tidevice version

3)列出连接设备   

tidevice list

tidevice list --json(以json格式展示)

2.tidevice远程操作真机

 1)查看已安装应用

tidevice applist

2)启动安装好的wda

tidevice xctest -B io.*.webdriver-test1.xctrunner

或者修改监听端口为8200,并显示调试日志

tidevice xctest -B io.*.webdriver-test15.xctrunner -e USB_PORT:8200 --debug

3)转发请求到手机,类似于iproxy

tidevice relay 8100 8100

或者转发并把传输的内容用hexdump的方法print出来

tidevice relay -x 8100 8100

将步骤2,3合为一个,用wdaproxy(wdaproxy这个命令会同时调用xctest和relay,另外当wda退出时,会自动重新启动xctest)

tidevice wdaproxy -B io.*.webdriver-test15.xctrunner --port 8100 

4)访问http://localhost:8100/status 出现下图可以确认 WDA 运行成功【注意这里要将步骤3和4保持不关闭,不然服务器链接不上】

5)安装应用

tidevice install 应用链接.ipa

      如tidevice install Desktop/345/6.22/iOS_v3.4.5-dailybuild.89046_202106220624_A.ipa(应用下载到本地,不要直接用http链接)

(参考:GitHub - alibaba/taobao-iphone-device: tidevice can be used to communicate with iPhone device )

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值