首页 > 其他分享 >关于airtest群控制ios

关于airtest群控制ios

时间:2022-12-16 15:55:44浏览次数:43  
标签:index iOS ios poco 报错 关于 airtest WebDriverAgent tidevice

1.安装carthage

brew install carthage 

2.下载项目

git clone https://github.com/facebookarchive/WebDriverAgent
./Scripts/bootstrap.sh 

#如果报错多半是node 版本的问题降版本https://registry.npmmirror.com/binary.html?path=node/v12.22.1/

2.构建时候报错统计

1.错误1

报错信息:Building for iOS, but the linked and embedded framework 'RoutingHTTPServer.framework' was built for iOS + iOS Simulator

解决办法:

在 targets 下的类别中,依次将 Build Settings 里的 Validate Workspace 修改为 Yes

2.报错2

报错信息:/WebDriverAgent/Carthage/Build/iOS/RoutingHTTPServer.framework/Headers/RouteResponse.h:2:9: Double-quoted include "HTTPResponse.h" in framework header, expected angle-bracketed instead

解决办法:

在 project 的 Build Settings 信息中,将 Quoted Include In Framework Header 修改为 false

3.报错3

WebDriverAgent-master/Carthage/Build/iOS/RoutingHTTPServer.framework/Headers/RouteResponse.h:8:1: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'

解决方式:将 assign 改为 strong ,并重新build,如下的两个错误同步解决掉(或:修改assign为unsafe_unretained)

4.报错4

sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

解决办法:在 project 的 Build Settings 信息中,将require only app-extension-safe api 修改为 false

5.报错5

WebDriverAgent-master/WebDriverAgentLib/Utilities/FBFailureProofTestCase.m:29:1: Implementing deprecated method

解决方法:将recordFailureWithDescription修改为recordIssue

3.用xcode将/WebDriverAgent在手机中成功运行一次

4.使用tidevice离线启动WebDriverAgent

1.安装

pip3 install tidevice 

2.相关指令

tidevice list #查看已连接设备
tidevice applist #查看设备上的第三方应用包名
tidevice -u $UDID #指定设备
tidevice xctest -B app报名   #运行app

3.注意事项

多台设备时间

tidevice -u 13bddfbf8c68b7018c2424fb6653e88cb0c32412 xctest -Bcom.facebook.WebDriverAgentRunnerwwww.xctrunner
#这台通过WebDriverAgent项目中全局8100改成8101
iproxy 8101 8101 -u 13bddfbf8c68b7018c2424fb6653e88cb0c32412  #必须加u

tidevice -u a5cf1c66d6f78f3fb711b9604a7187bc6c391210 xctest -B com.y.w.y.xctrunner
iproxy 8100 8100 -u a5cf1c66d6f78f3fb711b9604a7187bc6c391210  

4.airtest群控代码

1.安装

pip3 install airtest
pip3 install poco
pip3 install poco-ui

2.群控代码

import random
import time

from airtest.core.api import *
from airtest.cli.parser import cli_setup
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
from poco.drivers.ios import iosPoco
from multiprocessing import Process



kuaituantuan_code_table = yunji_db['kuaituantuan_code']

def get_ios_poco(index):
    print(index)
    for index_int in range(index+1):
        print(index_int)
        connect_device(f"iOS:///http://127.0.0.1:810{index_int}")
    set_current(index)  #本质G.DEVICE_LIST 群控核心用好G这个对象
    dev = device()
    poco = iosPoco(device= dev)
    return poco,dev

  
def Initialization(index):
    poco,dev =get_ios_poco(index)
    keyevent("Home")
    
    
if __name__ == '__main__':
    process_1 = Process(target=Initialization, args=(0,))
    process_2 = Process(target=Initialization, args=(1,))
    process_1.start()
    process_2.start()
    process_1.join()
    process_2.join()

标签:index,iOS,ios,poco,报错,关于,airtest,WebDriverAgent,tidevice
From: https://www.cnblogs.com/pythonywy/p/16987577.html

相关文章

  • uniapp开发的微信小程序页面在IOS上页面可被拖拽的问题
    经排查发现是设计稿宽度不是750px而IOS宽度最低都是375(750/2)这时如果你的设计稿是751px的在IOS上就可以被自由拖拽 解决方案:1让UI出750px的设计稿2设......
  • 肯天chem trend | 关于螺杆清洗料的答案都在这里
    大家都知道肯天的螺杆清洗料可以助力您提高生产效率、改进生产力和产品质量,为您和您的运营提供了巨大的机会。当然,关于它的一系列问题,你也一定要知晓哦!更多肯天脱模剂及螺杆......
  • iOS 申请证书(开发与发布)(开发者帐号开通后)
    苹果开发者帐号开通后,即了购买服务后。苹果APP需要上架,也提供了新的开发者账号,所以就顺带把申请证书与发布流程写一遍。0.先创建苹果钥匙串文件(在苹果电脑PC(一体机、笔记本......
  • 关于2023届互联网秋招,我想简单说两句
    我是一名2023届双非毕业生(软件工程专业,无实习经历),大概从7月开始吧,打磨简历、刷笔试题、看面经、找公司、投简历、做性格测试、做笔试、面试、总结面试,之后再次打磨简历。。......
  • [过程]《关于我对宝可梦很感兴趣,作为新手想写一个宝可梦检索这件事》
    我的想法是,先写一个类似主页的主程序,然后用它作为父类,调用子程序的各个小工具。importjava.util.Scanner;publicclasspokemon_major{publicstaticvoidmain(Stri......
  • Linux命令iostat使用,输出的参数分析
    Linuxiostat命令编译iostat源码位于sysstat中,编译其会在bin目录下得到iostat可执行文件;iostat命令参数解析iostat命令输出解析iostat[-c][-d][-h][-N][......
  • 关于我的 “二进制部署 kubernetes 集群” 的体验
    文章目录​​体会​​​​博客整理​​​​调研阶段​​​​部署篇​​​​中期补充调研​​​​后期预计调研​​​​问题解决方案​​体会关于这个事情,终于是告一段落了。......
  • 关于报表打印
    1分页策略分页与打印时密切相关的,皕杰报表提供了四种分页策略,即按纸张大小分页、按数据行数分页、按数据列数分页、用户自定义分页和不分页。分页由2个因素来控制,一个每个......
  • android(安卓)cocos2d-x关于防止游戏中锁屏问题
    于是又在群里问,一般的群里不是在聊女人,就是在瞎扯蛋。在我很失落的时候,群里有一个人主动密我,告诉我安卓里的锁屏是怎么回事。于是我很感动。这位朋友,给了我一个网页。我......
  • 关于C++20协程的系列文章
    https://www.cnblogs.com/ishen/p/14617708.html https://www.bennyhuo.com/2022/03/20/cpp-coroutines-05-dispatcher/ https://matpool.com/blog/6048282f505b8f00......