def main(): args = parse_options() print(args) device_type = args.type.lower() device_udid = args.udid execution_mode = args.mode.lower() config_file = args.config if device_type is None or device_type not in ["android", "ios"]: print("device type 参数指定错误; 使用 --help 命令查看详情") sys.exit(1) if device_udid is None: print("device udid 参数指定错误; 使用 --help 命令查看详情") sys.exit(1) if execution_mode is None or execution_mode not in EXECUTION_MODE: print("execution mode 参数指定错误; 使用 --help 命令查看详情") sys.exit(1) if config_file is None or FileUtils.file_available(config_file) is False: print("config file 参数指定错误; 使用 --help 命令查看详情") sys.exit(1) logger.info("config: device type is {0}".format(device_type)) logger.info("config: device udid is {0}".format(device_udid)) logger.info("config: execution mode is {0}".format(execution_mode)) logger.info("config: yaml config file is {0}".format(config_file)) builder = Builder(config_file=config_file, udid=device_udid, mode=execution_mode, device_type=device_type) builder.exe()