if len(devicess) > 0: mk_file('iOS') l_devices = [] for dev in devicess: app = {} app["devices"] = dev app["port"] = str(random.randint(4700, 4900)) app["bport"] = str(random.randint(4700, 4900)) app["app"] = BaseInit.ipaPath l_devices.append(app) appium_server = AppiumServer(l_devices) appium_server.start_server() runnerPool(l_devices) writeExcel() appium_server.stop_server(l_devices) # 删除temp文件 remove_file(PATH("../yamls/temp.yaml")) print("============开始导出crashreport==========") find_str = 'XiaoYing-' # 待测app crashreport文件关键字 file_format1 = [".ips"] # 导出的crash文件后缀 file_format2 = [".crash"] # 解析后的crash文件后缀 reportPath = PATH("../Log/CrashInfo/iOS/") beforePath = os.path.join(reportPath + '/Before') if not os.path.exists(beforePath): os.makedirs(beforePath)
unittest.TextTestRunner(verbosity=2).run(suite) endtime = datetime.now() countDate(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), str((endtime - starttime).seconds) + "秒") if __name__ == '__main__': kill_adb() devicess = AndroidDebugBridge().attached_devices() if len(devicess) > 0: mk_file() l_devices = [] for dev in devicess: app = {} app["devices"] = dev init(dev) app["port"] = str(random.randint(4700, 4900)) app["bport"] = str(random.randint(4700, 4900)) app["systemPort"] = str(random.randint(4700, 4900)) app["app"] = PATH("../app/com.ximalaya.ting.android.apk") # 测试的app路径,喜马拉雅app l_devices.append(app) appium_server = AppiumServer(l_devices) appium_server.start_server() runnerPool(l_devices) writeExcel() appium_server.stop_server(l_devices) else: print("没有可用的安卓设备")