diff --git a/wda/__init__.py b/wda/__init__.py index d011b8f..e33ded8 100644 --- a/wda/__init__.py +++ b/wda/__init__.py @@ -1347,7 +1347,7 @@ def _fix_xcui_type(self, s): if s is None: return re_element = '|'.join(xcui_element_types.ELEMENTS) - return re.sub(r'/(' + re_element + ')', '/XCUIElementType\g<1>', s) + return re.sub(r'/(' + re_element + ')', r'/XCUIElementType\g<1>', s) def _add_escape_character_for_quote_prime_character(self, text): """ @@ -1762,7 +1762,10 @@ def selected(self): class USBClient(Client): """ connect device through unix:/var/run/usbmuxd """ - def __init__(self, udid: str = "", port: int = 8100): + def __init__(self, udid: str = "", port: int = 8100, wda_bundle_id: Optional[str] = None): + """ + wda_bundle_id: useless now, just for compability + """ if not udid: infos = [info for info in list_devices() if info.connection_type == 'USB'] if len(infos) == 0: @@ -1772,7 +1775,5 @@ def __init__(self, udid: str = "", port: int = 8100): udid = infos[0].serial super().__init__(url=f"http+usbmux://{udid}:{port}") - if self.is_ready(): - return - - raise RuntimeError("WDA is not ready after waiting for 20 seconds") + # if not self.wait_ready(timeout=20, noprint=True): + # raise RuntimeError("WDA is not ready after waiting for 20 seconds")