diff --git a/airtest/core/ios/ios.py b/airtest/core/ios/ios.py index 4bf5fe9b..e80a7e65 100644 --- a/airtest/core/ios/ios.py +++ b/airtest/core/ios/ios.py @@ -648,7 +648,13 @@ def __init__(self, addr=DEFAULT_ADDR, cap_method=CAP_METHOD.MJPEG, mjpeg_port=No self.udid = udid else: self.udid = parsed - self.driver = wda.USBClient(udid=self.udid, port=8100, wda_bundle_id=self.wda_bundle_id) + try: + self.driver = wda.USBClient(udid=self.udid, port=8100, wda_bundle_id=self.wda_bundle_id) + except Exception as e: + # windows connect ios devices fail:USBClient.__init__() got an unexpected keyword argument 'wda_bundle_id' + LOGGING.warning("USBClient.__init__() error: {msg}".format(msg=e)) + self.driver = wda.USBClient(udid=self.udid, port=8100) + # Record device's width and height. self._size = {'width': None, 'height': None} self._current_orientation = None