1. 简单入门1.1 准备
图1. AirtestIDE 后台日志
图2. AirtestIDE UI界面
1.3 连接设备
1.4 UI定位
图4. AirtestIDE UI定位
1.5 脚本
1.6 运行
2. 多线程中使用Airtest
2.1 安装
2.2 多设备连接
fromairtest.core.apiimport*frompoco.drivers.android.uiautomationimportAndroidUiautomationPoco
classAndroidUiautomationHelper(object):_nuis={}@classmethoddefget_instance(cls,device):&
classKeepRunningInstrumentationThread(threading.Thread):&
2.4 设备异常处理
defrshell_nowait(self,command,proc_name):&
defcheck_device(serialno,retries=3):for_inrange(retries)try:adb=ADB(serialno)adb.wait_for_device(timeout=timeout)devices=[item[0]foriteminadb.devices(state=&
defsilent(func):&
3.结语
以上就是朝夕生活(www.30zx.com)关于“Airtest入门及多设备管理总结”的详细内容,希望对大家有所帮助!