Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions wda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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:
Expand All @@ -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")