From 9bd66a31c0d5b4b33988472304edf34bb9e31d1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:20:26 +0000 Subject: [PATCH 1/4] Initial plan From b041c7773dd2c34c041164d15d4cc75f7c705733 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:29:02 +0000 Subject: [PATCH 2/4] Fix unreachable exception in USBClient and syntax warning Co-authored-by: codeskyblue <3281689+codeskyblue@users.noreply.github.com> --- wda/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wda/__init__.py b/wda/__init__.py index d011b8f..b831300 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): """ @@ -1772,7 +1772,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 - + if not self.wait_ready(timeout=20, noprint=True): raise RuntimeError("WDA is not ready after waiting for 20 seconds") From 8e823971ed2c08ea23ac6b27c76ab851e0757fd0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 09:05:55 +0000 Subject: [PATCH 3/4] Add wda_bundle_id parameter to USBClient for future use Co-authored-by: codeskyblue <3281689+codeskyblue@users.noreply.github.com> --- wda/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wda/__init__.py b/wda/__init__.py index b831300..9a7b262 100644 --- a/wda/__init__.py +++ b/wda/__init__.py @@ -1762,7 +1762,7 @@ 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: str = None): if not udid: infos = [info for info in list_devices() if info.connection_type == 'USB'] if len(infos) == 0: From be6dbde726a9d4b61c951df6d4920c023ac1cd2b Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Tue, 4 Nov 2025 08:48:59 +0800 Subject: [PATCH 4/4] fix missing wda_bundle_id --- wda/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wda/__init__.py b/wda/__init__.py index 9a7b262..e33ded8 100644 --- a/wda/__init__.py +++ b/wda/__init__.py @@ -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, wda_bundle_id: str = None): + 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,5 +1775,5 @@ def __init__(self, udid: str = "", port: int = 8100, wda_bundle_id: str = None): udid = infos[0].serial super().__init__(url=f"http+usbmux://{udid}:{port}") - if not self.wait_ready(timeout=20, noprint=True): - 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")