Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS运行一段时间后莫名无响应,断开连接 #1261

Open
1 task done
lanchuanshuang opened this issue Nov 12, 2024 · 0 comments
Open
1 task done

iOS运行一段时间后莫名无响应,断开连接 #1261

lanchuanshuang opened this issue Nov 12, 2024 · 0 comments

Comments

@lanchuanshuang
Copy link

💡相关项目: Airtest

标题: [BUG提交]iOS裕兴一段时间后莫名无响应,断开连接

AirtestIDE版本:

  • 使用了本地Pyhton环境运行脚本
  • Python版本: 3.9
  • Airtest版本: v1.3.5

报错描述:
    背景:我是写的Python脚本,对很多App做灰度测试,每次运行App数量大约10-20个,每个App运行的代码相同,使用多个循环实现,急切需要得到回复或解决,研究过很多方式,三个链接方式wda都试过了,也分别试过mac和windows,问题依旧。
问题:在运行到8-10个App时会莫名时区通讯,问题必现,报错内容:wda.usbmux.exceptions.HTTPError: got an error message: {'MessageType': 'Result', 'Number': 3}
url = 'http+usbmux://c8da964b6373236c309909ee09b4db2b1f06a61b:8100/screenshot'
method = 'GET', data = None, timeout = 180.0

相关截图:

报错Log:

wda.usbmux.exceptions.HTTPError: got an error message: {'MessageType': 'Result', 'Number': 3}
url = 'http+usbmux://c8da964b6373236c309909ee09b4db2b1f06a61b:8100/screenshot'
method = 'GET', data = None, timeout = 180.0

    def fetch(url: str, method="GET", data=None, timeout=None) -> HTTPResponseWrapper:
        """
        thread safe http request
    
        Raises:
            HTTPError
        """
        try:
            method = method.upper()
            conn = http_create(url)
            conn.timeout = timeout
            u = urlparse(url)
            urlpath = url[len(u.scheme) + len(u.netloc) + 3:]
    
            if not data:
                conn.request(method, urlpath)
            else:
                conn.request(method, urlpath, json.dumps(data), headers={"Content-Type": "application/json"})
>           response = conn.getresponse()

D:\ui\.venv\lib\site-packages\wda\usbmux\__init__.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:1377: in getresponse
    response.begin()
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:320: in begin
    version, status, reason = self._read_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <http.client.HTTPResponse object at 0x0000028E38C35700>

    def _read_status(self):
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
        if len(line) > _MAXLINE:
            raise LineTooLong("status line")
        if self.debuglevel > 0:
            print("reply:", repr(line))
        if not line:
            # Presumably, the server closed the connection before
            # sending a valid response.
>           raise RemoteDisconnected("Remote end closed connection without"
                                     " response")
E           http.client.RemoteDisconnected: Remote end closed connection without response

..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:289: RemoteDisconnected

During handling of the above exception, another exception occurred:

    def test_run_ios_app():
        auto_setup(__file__, logdir=True)
        # ipa_path = "test_cash.air/test_ios_ui.air/aPebllaCustomerApp.ipa"
        # udid = "c8da964b6373236c309909ee09b4db2b1f06a61b"
        # command = ["tidevice", "--udid", udid, "install", ipa_path]
        #
        # # 使用subprocess运行命令
        # result = subprocess.run(command, capture_output=True, text=True)
        # print("stdout:", result.stdout)
        # print("stderr:", result.stderr)
        # def install_ipa(ipa_path):
        #     # 连接设备
        #     connect = subprocess.run(['idevice_id', '-l'], capture_output=True, text=True)
        #     if connect.returncode != 0:
        #         print("未检测到设备,请连接设备。")
        #         return
        #
        #     device_id = connect.stdout.strip()
        #     if not device_id:
        #         print("未检测到设备,请确保设备已连接并解锁。")
        #         return
        #
        #     # 安装 IPA
        #     result = subprocess.run(['ideviceinstaller', '-u', device_id, '-i', ipa_path], capture_output=True, text=True)
        #     if result.returncode == 0:
        #         print("安装成功")
        #     else:
        #         print("安装失败:", result.stderr)
    
        # 使用示例
        # ipa_path = '/path/to/your/app.ipa'
        # install_ipa(ipa_path)
        gray_scale_phase = get_value("gray_scale_phase")
        for gray_scale_phase in gray_scale_phase:
            start_row, apk_list, url_list, app_name_list, app_count = get_gray_scale_phase_app(gray_scale_phase, devices_type="iOS")
            # start_row = 1
            # apk_list = ["com.alaeat.customer.ios.districtfalafel", "com.alaeat.customer.ios.tigerdumplingsllc"]
            # app_name_list = ["District Falafel", "Tiger Dumplings"]
            # app_count = len(app_name_list)
            # tidevice install "a.ipa"
            log(f" = = = 开始灰度{gray_scale_phase}:App{app_name_list}= = = ")
            if gray_scale_phase == 0:
                gray_scale_phase = "all"
            else:
                pass
            width = G.DEVICE.display_info['width']
            height = G.DEVICE.display_info['height']
            x = 0.5 * width
            y1 = 0.3 * height
            y2 = 0.8 * height
            poco = iosPoco()
            file_name = f"C:/Users/18199/PycharmProjects/Branded_UI/app截图/iOS/灰度{gray_scale_phase}_iOS"
            # 清空之前的截图
            clear_printscreen(file_name)
            for i in range(app_count):
                apk_name = apk_list[i]
                app_name = app_name_list[i]
                log(i, desc="====" + app_name + " 开始测试=====")
                try:
                    poco = iosPoco()
                    log("打开App")
                    start_app(apk_name)
                    time.sleep(5)
                    """权限处理"""
                    log("定位权限")
                    if poco(nameMatches=".*使用您的位置?"):
                        log("1232341342314231423142")
                        touch(Template(r"tpl1720342799180.png", record_pos=(0.007, 0.413), resolution=(1125, 2436)))
                    elif poco("使用App时允许"):
                        poco("使用App时允许").click()
                    log("通知权限")
>                   if exists(Template(r"tpl1720343194154.png", record_pos=(0.008, 0.081), resolution=(1125, 2436))):

test_cash.air\test_ios_ui.air\test_ios_ui.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
D:\ui\.venv\lib\site-packages\airtest\utils\logwraper.py:134: in wrapper
    res = f(*args, **kwargs)
D:\ui\.venv\lib\site-packages\airtest\core\api.py:642: in exists
    pos = loop_find(v, timeout=ST.FIND_TIMEOUT_TMP)
D:\ui\.venv\lib\site-packages\airtest\utils\logwraper.py:134: in wrapper
    res = f(*args, **kwargs)
D:\ui\.venv\lib\site-packages\airtest\core\cv.py:62: in loop_find
    screen = G.DEVICE.snapshot(filename=None, quality=ST.SNAPSHOT_QUALITY)
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:53: in wrapper
    return func(self, *args, **kwargs)
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:966: in snapshot
    data = self._neo_wda_screenshot()
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:951: in _neo_wda_screenshot
    value = self.driver.http.get('screenshot').value
D:\ui\.venv\lib\site-packages\wda\utils.py:47: in _inner
    return fn(*args, **kwargs)
D:\ui\.venv\lib\site-packages\wda\__init__.py:390: in _fetch
    response = httpdo(url, method, data, timeout)
D:\ui\.venv\lib\site-packages\wda\__init__.py:116: in httpdo
    return _unsafe_httpdo(url, method, data, timeout)
D:\ui\.venv\lib\site-packages\wda\__init__.py:131: in _unsafe_httpdo
    response = fetch(url, method, data, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'http+usbmux://c8da964b6373236c309909ee09b4db2b1f06a61b:8100/screenshot'
method = 'GET', data = None, timeout = 180.0

    def fetch(url: str, method="GET", data=None, timeout=None) -> HTTPResponseWrapper:
        """
        thread safe http request
    
        Raises:
            HTTPError
        """
        try:
            method = method.upper()
            conn = http_create(url)
            conn.timeout = timeout
            u = urlparse(url)
            urlpath = url[len(u.scheme) + len(u.netloc) + 3:]
    
            if not data:
                conn.request(method, urlpath)
            else:
                conn.request(method, urlpath, json.dumps(data), headers={"Content-Type": "application/json"})
            response = conn.getresponse()
            content = bytearray()
            while chunk := response.read(4096):
                content.extend(chunk)
            resp = HTTPResponseWrapper(content, response.status)
            return resp
        except Exception as e:
>           raise HTTPError(e)
E           wda.usbmux.exceptions.HTTPError: Remote end closed connection without response

D:\ui\.venv\lib\site-packages\wda\usbmux\__init__.py:70: HTTPError

During handling of the above exception, another exception occurred:

url = 'http+usbmux://c8da964b6373236c309909ee09b4db2b1f06a61b:8100/screenshot'
method = 'GET', data = None, timeout = 180.0

    def fetch(url: str, method="GET", data=None, timeout=None) -> HTTPResponseWrapper:
        """
        thread safe http request
    
        Raises:
            HTTPError
        """
        try:
            method = method.upper()
            conn = http_create(url)
            conn.timeout = timeout
            u = urlparse(url)
            urlpath = url[len(u.scheme) + len(u.netloc) + 3:]
    
            if not data:
>               conn.request(method, urlpath)

D:\ui\.venv\lib\site-packages\wda\usbmux\__init__.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:1285: in request
    self._send_request(method, url, body, headers, encode_chunked)
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:1331: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:1280: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:1040: in _send_output
    self.send(msg)
..\..\AppData\Local\Programs\Python\Python39\lib\http\client.py:980: in send
    self.connect()
D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:479: in connect
    self.sock = self.__device.connect(self.__port)
D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:96: in connect
    return mux.connect(self, port)
D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:237: in connect
    self._connect(device.devid, socket.htons(port))
D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:395: in _connect
    self._send_receive({'MessageType': 'Connect', 'DeviceID': device_id, 'PortNumber': port})
D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:418: in _send_receive
    raise self._raise_mux_exception(response['Number'], f'got an error message: {response}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <wda.usbmux.pyusbmux.PlistMuxConnection object at 0x0000028E38883FA0>
result = 3
message = "got an error message: {'MessageType': 'Result', 'Number': 3}"

    def _raise_mux_exception(self, result: int, message: str = None):
        exceptions = {
            int(usbmuxd_result.BADCOMMAND): BadCommandError,
            int(usbmuxd_result.BADDEV): BadDevError,
            int(usbmuxd_result.CONNREFUSED): MuxConnectError,
            int(usbmuxd_result.BADVERSION): MuxVersionError,
        }
        exception = exceptions.get(result, MuxError)
>       raise exception(message)
E       wda.usbmux.exceptions.MuxConnectError: got an error message: {'MessageType': 'Result', 'Number': 3}

D:\ui\.venv\lib\site-packages\wda\usbmux\pyusbmux.py:258: MuxConnectError

During handling of the above exception, another exception occurred:

    def test_run_ios_app():
        auto_setup(__file__, logdir=True)
        # ipa_path = "test_cash.air/test_ios_ui.air/aPebllaCustomerApp.ipa"
        # udid = "c8da964b6373236c309909ee09b4db2b1f06a61b"
        # command = ["tidevice", "--udid", udid, "install", ipa_path]
        #
        # # 使用subprocess运行命令
        # result = subprocess.run(command, capture_output=True, text=True)
        # print("stdout:", result.stdout)
        # print("stderr:", result.stderr)
        # def install_ipa(ipa_path):
        #     # 连接设备
        #     connect = subprocess.run(['idevice_id', '-l'], capture_output=True, text=True)
        #     if connect.returncode != 0:
        #         print("未检测到设备,请连接设备。")
        #         return
        #
        #     device_id = connect.stdout.strip()
        #     if not device_id:
        #         print("未检测到设备,请确保设备已连接并解锁。")
        #         return
        #
        #     # 安装 IPA
        #     result = subprocess.run(['ideviceinstaller', '-u', device_id, '-i', ipa_path], capture_output=True, text=True)
        #     if result.returncode == 0:
        #         print("安装成功")
        #     else:
        #         print("安装失败:", result.stderr)
    
        # 使用示例
        # ipa_path = '/path/to/your/app.ipa'
        # install_ipa(ipa_path)
        gray_scale_phase = get_value("gray_scale_phase")
        for gray_scale_phase in gray_scale_phase:
            start_row, apk_list, url_list, app_name_list, app_count = get_gray_scale_phase_app(gray_scale_phase, devices_type="iOS")
            # start_row = 1
            # apk_list = ["com.alaeat.customer.ios.districtfalafel", "com.alaeat.customer.ios.tigerdumplingsllc"]
            # app_name_list = ["District Falafel", "Tiger Dumplings"]
            # app_count = len(app_name_list)
            # tidevice install "a.ipa"
            log(f" = = = 开始灰度{gray_scale_phase}:App{app_name_list}= = = ")
            if gray_scale_phase == 0:
                gray_scale_phase = "all"
            else:
                pass
            width = G.DEVICE.display_info['width']
            height = G.DEVICE.display_info['height']
            x = 0.5 * width
            y1 = 0.3 * height
            y2 = 0.8 * height
            poco = iosPoco()
            file_name = f"C:/Users/18199/PycharmProjects/Branded_UI/app截图/iOS/灰度{gray_scale_phase}_iOS"
            # 清空之前的截图
            clear_printscreen(file_name)
            for i in range(app_count):
                apk_name = apk_list[i]
                app_name = app_name_list[i]
                log(i, desc="====" + app_name + " 开始测试=====")
                try:
                    poco = iosPoco()
                    log("打开App")
                    start_app(apk_name)
                    time.sleep(5)
                    """权限处理"""
                    log("定位权限")
                    if poco(nameMatches=".*使用您的位置?"):
                        log("1232341342314231423142")
                        touch(Template(r"tpl1720342799180.png", record_pos=(0.007, 0.413), resolution=(1125, 2436)))
                    elif poco("使用App时允许"):
                        poco("使用App时允许").click()
                    log("通知权限")
                    if exists(Template(r"tpl1720343194154.png", record_pos=(0.008, 0.081), resolution=(1125, 2436))):
                        touch(Template(r"tpl1720343194154.png", record_pos=(0.184, 0.175), resolution=(1125, 2436)))
                    elif poco("声音和图标标"):
                        touch(Template(r"tpl1720343194154.png", record_pos=(0.184, 0.175), resolution=(1125, 2436)))
                    else:
                        pass
                    log("网络权限")
                    if poco(name="关闭无线数据时,部分功能可能无法使用。"):
                        touch(Template(r"tpl1720514817379.png", record_pos=(-0.002, 0.049), resolution=(1125, 2436)))
                    # Popup1
                    if exists(Template(r"tpl1719456647895.png", record_pos=(0.005, 0.627), resolution=(1080, 2340))):
                        touch(Template(r"tpl1719456647895.png", record_pos=(0.005, 0.627), resolution=(1080, 2340)))
                    else:
                        pass
                    # Popup2(张亮麻辣烫)
                    if exists(Template(r"tpl1719643749772.png", record_pos=(0.003, 0.635), resolution=(1080, 2340))):
                        touch(Template(r"tpl1719643749772.png", record_pos=(0.003, 0.635), resolution=(1080, 2340)))
                    if exists(Template(r"tpl1721030722699.png", record_pos=(-0.001, 0.632), resolution=(1080, 2340))):
                        touch(Template(r"tpl1721030722699.png", record_pos=(-0.001, 0.632), resolution=(1080, 2340)))
                    else:
                        pass
                    time.sleep(2)
                    """判断是否登录"""
                    if poco(nameMatches="(\d\s)?Account.*"):
                        poco(nameMatches="(\d\s)?Account.*").click()
                        for t in range(2):
                            swipe((x, y2), (x, y1))
                        if poco(name="Logout"):
                            poco(name="Logout").click()
                        time.sleep(2)
                        if poco(name="Exit Prompt"):
                            poco(name="YES").click()
                    time.sleep(2)
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if exists(Template(r"tpl1721013716287.png", record_pos=(-0.392, 0.948), resolution=(1125, 2436))):
                            touch(Template(r"tpl1721013716287.png", record_pos=(-0.392, 0.948), resolution=(1125, 2436)))
                    elif exists(Template(r"tpl1721013384419.png", record_pos=(-0.397, 0.981), resolution=(1125, 2436))):
                        touch(Template(r"tpl1721013384419.png", record_pos=(-0.397, 0.981), resolution=(1125, 2436)))
                    time.sleep(2)
                    # 截图首页
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Home.png"), exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Home.png")
                    if poco(nameMatches="Order.*"):
                        poco(nameMatches="Order.*").click()
                        time.sleep(5)
                    if poco(name="Select Store"):
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Order_list.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Order_list.png")
                        log("123213123", app_name)
                        if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                            touch((981, 1878))
                        else:
                            touch((969, 1661))
                        if exists(Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                            touch(Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                        elif exists(Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                            touch(Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                        time.sleep(0.5)
                        if poco(nameMatches="The store is far away.*"):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/too_far.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/too_far.png")
                            poco(name="OK").click()
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                            time.sleep(0.5)
                        elif poco(name="Not Closest Store"):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/juligengjin.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/juligengjin.png")
                            poco(name="Keep Selected ").click()
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                            time.sleep(0.5)
                        elif poco(name="Group Order"):
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                        else:
                            if exists(Template(r"tpl1722586924560.png", record_pos=(-0.136, -0.907),
                                               resolution=(1125, 2436))):
                                touch(Template(r"tpl1722587685406.png", target_pos=4, record_pos=(-0.139, -0.906),
                                               resolution=(1125, 2436)))
                            else:
                                if exists(Template(r"tpl1720356867395.png", record_pos=(-0.427, -0.945),
                                                   resolution=(1125, 2436))):
                                    touch(Template(r"tpl1720356867395.png", record_pos=(-0.427, -0.945),
                                                   resolution=(1125, 2436)))
                        time.sleep(2)
                    else:
                        pass
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Order.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Order.png")
                    if poco(nameMatches="Rewards.*"):
                        poco(nameMatches="Rewards.*").click()
                        time.sleep(3)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Rewards.png"), exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Rewards.png")
                    if poco(nameMatches="History.*"):
                        poco(nameMatches="History.*").click()
                        time.sleep(3)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/History.png"), exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/History.png")
                    if poco(nameMatches="(\d\s)?Account.*"):
                        poco(nameMatches="(\d\s)?Account.*").click()
                        time.sleep(3)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Account.png"), exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Account.png")
                    for t in range(2):
                        swipe((x, y1), (x, y2))
                    if exists(Template(r"tpl1722392719676.png", record_pos=(-0.192, -0.841), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722392719676.png", record_pos=(-0.192, -0.841), resolution=(1125, 2436)))
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Login.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Login.png")
                        time.sleep(1)
                        # poco(name="Phone Number").click()
                        time.sleep(0.5)
                        # poco(name="Phone Number").set_text("1867839985")
                        text("1867839985")
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Login_2.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Login_2.png")
                    if poco(label="Sign In / Sign Up"):
                        poco(label="Sign In / Sign Up").click()
                    time.sleep(1)
                    if poco(name="Done"):
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/code.png"), exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/code.png")
                        poco(name="Done").click()
                    time.sleep(1)
                    """Member Code"""
                    if exists(Template(r"tpl1722842695990.png", record_pos=(0.427, -0.813), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722842695990.png", record_pos=(0.427, -0.813), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Member_code.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Member_code.png")
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if exists(Template(r"tpl1722843070639.png", record_pos=(0.003, 0.93), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722843070639.png", record_pos=(0.003, 0.93), resolution=(1125, 2436)))
                    else:
                        if exists(Template(r"tpl1722842865386.png", target_pos=6, record_pos=(0.082, -0.404),
                                           resolution=(1125, 2436))):
                            touch(Template(r"tpl1722842865386.png", target_pos=6, record_pos=(0.082, -0.404),
                                           resolution=(1125, 2436)))
                    for t in range(2):
                        swipe((x, y2), (x, y1))
                    """Mange Account"""
                    if exists(Template(r"tpl1722844465568.png", record_pos=(-0.295, -0.291), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844465568.png", record_pos=(-0.295, -0.291), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/manage_account.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/manage_account.png")
                    if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    """Address Management"""
                    if exists(Template(r"tpl1722844732905.png", record_pos=(-0.238, -0.126), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844732905.png", record_pos=(-0.238, -0.126), resolution=(1125, 2436)))
                    time.sleep(1)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Address_Management.png")
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if exists(Template(r"tpl1722845620854.png", record_pos=(0.001, 0.94), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722845620854.png", record_pos=(0.001, 0.94), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management2.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management2.png")
                        if exists(Template(r"tpl1722845814690.png", record_pos=(0.003, -0.074), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722845814690.png", record_pos=(0.003, -0.074), resolution=(1125, 2436)))
                        text("1800 rockville")
                        time.sleep(1)
                        if exists(Template(r"tpl1722845963991.png", record_pos=(-0.104, 0.079), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722845963991.png", record_pos=(-0.104, 0.079), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management3.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management3.png")
                        if exists(Template(r"tpl1722846075166.png", record_pos=(0.017, 0.942), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722846075166.png", record_pos=(0.017, 0.942), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management_list.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management_list.png")
                        if exists(Template(r"tpl1722846241795.png", record_pos=(0.348, -0.84), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722846241795.png", record_pos=(0.348, -0.84), resolution=(1125, 2436)))
                        if exists(Template(r"tpl1722846275477.png", record_pos=(0.431, -0.524), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722846275477.png", record_pos=(0.431, -0.524), resolution=(1125, 2436)))
                        if poco(name="Delete Address"):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management4.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/Address_Management4.png")
                            poco(name="Confirm").click()
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management5.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management5.png")
                        if exists(Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436)))
                    else:
                        if poco(name="Add Address"):
                            poco(name="Add Address").click()
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management2.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management2.png")
                        if poco(name="Your Address"):
                            poco(name="Your Address").click()
                        text("1800 rock")
                        time.sleep(1)
                        if exists(Template(r"tpl1722845155559.png", record_pos=(-0.119, -0.289), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722845155559.png", record_pos=(-0.119, -0.289), resolution=(1125, 2436)))
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management3.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management3.png")
                        if poco(name="Save"):
                            poco(name="Save").click()
                        time.sleep(0.5)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management_list.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Address_Management_list.png")
                        if poco(name="Manage"):
                            poco(name="Manage").click()
                        if exists(Template(r"tpl1722845323209.png", record_pos=(0.435, -0.76), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722845323209.png", record_pos=(0.435, -0.76), resolution=(1125, 2436)))
                        if exists(Template(r"tpl1722845387560.png", record_pos=(-0.003, -0.085), resolution=(1125, 2436))):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management4.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/Address_Management4.png")
                            time.sleep(0.5)
                            poco(name="Confirm").click()
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Address_Management5.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/Address_Management5.png")
                        if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                            touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    """Notifications"""
                    if poco(nameMatches="Notification.*"):
                        poco(nameMatches="Notification.*").click()
                        time.sleep(0.5)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Notifications.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Notifications.png")
                    if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    """My Reviews"""
                    if poco(nameMatches="My Review.*"):
                        poco(nameMatches="My Review.*").click()
                    time.sleep(0.5)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/My Reviews.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/My Reviews.png")
                    if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    """Payment Methods"""
                    if poco(name="Payment Methods"):
                        poco(name="Payment Methods").click()
                    time.sleep(0.5)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Payment Methods.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Payment Methods.png")
                    if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    """Submit App Feedback"""
                    if poco(name="Submit App Feedback"):
                        poco(name="Submit App Feedback").click()
                    time.sleep(0.5)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Submit App Feedback.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Submit App Feedback.png")
                    if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                        touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    time.sleep(1)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Account_version_number.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Account_version_number.png")
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if exists(Template(r"tpl1721013716287.png", record_pos=(-0.392, 0.948), resolution=(1125, 2436))):
                            touch(Template(r"tpl1721013716287.png", record_pos=(-0.392, 0.948), resolution=(1125, 2436)))
                    elif app_name == "Akira Ramen & Izakaya":
                        if exists(Template(r"tpl1723196086345.png", record_pos=(-0.387, 0.983), resolution=(1080, 2340))):
                            touch(Template(r"tpl1723196086345.png", record_pos=(-0.387, 0.983), resolution=(1080, 2340)))
                    elif app_name == "Rice Culture":
                        if exists(Template(r"tpl1723196229734.png", record_pos=(-0.393, 0.979), resolution=(1080, 2340))):
                            touch(Template(r"tpl1723196229734.png", record_pos=(-0.393, 0.979), resolution=(1080, 2340)))
                    elif app_name == "Yomie’s Rice & Yogurt" or app_name == "Yomie's Rice & Yogurt":
                        if exists(Template(r"tpl1723196284423.png", record_pos=(-0.389, 0.985), resolution=(1080, 2340))):
                            touch(Template(r"tpl1723196284423.png", record_pos=(-0.389, 0.985), resolution=(1080, 2340)))
                    else:
                        exists(Template(r"tpl1721013384419.png", record_pos=(-0.397, 0.981), resolution=(1125, 2436)))
                        touch(Template(r"tpl1721013384419.png", record_pos=(-0.397, 0.981), resolution=(1125, 2436)))
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Home_logged.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Home_logged.png")
                    if poco(nameMatches="Order.*"):
                        poco(nameMatches="Order.*").click()
                        time.sleep(5)
                    if poco(name="Select Store"):
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Order_list_login.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Order_list_login.png")
                        log("123213123", app_name)
                        if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                            touch((981, 1878))
                        else:
                            touch((969, 1661))
                        if exists(Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                            touch(Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                        elif exists(Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                            touch(Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                        time.sleep(0.5)
                        if poco(nameMatches="The store is far away.*"):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/too_far_login.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/too_far_login.png")
                            poco(name="OK").click()
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                            time.sleep(0.5)
                        elif poco(name="Not Closest Store"):
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/juligengjin_login.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/juligengjin_login.png")
                            poco(name="Keep Selected ").click()
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                            time.sleep(0.5)
                        elif poco(name="Group Order"):
                            if exists(
                                    Template(r"tpl1719653869630.png", record_pos=(0.006, -0.778), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719653875379.png", record_pos=(0.413, -0.786), resolution=(1080, 2340)))
                            elif exists(
                                    Template(r"tpl1719656751921.png", record_pos=(0.001, -0.736), resolution=(1080, 2340))):
                                touch(
                                    Template(r"tpl1719656761030.png", record_pos=(0.432, -0.901), resolution=(1080, 2340)))
                        else:
                            if exists(Template(r"tpl1722586924560.png", record_pos=(-0.136, -0.907),
                                               resolution=(1125, 2436))):
                                touch(Template(r"tpl1722587685406.png", target_pos=4, record_pos=(-0.139, -0.906),
                                               resolution=(1125, 2436)))
                            else:
                                if exists(Template(r"tpl1720356867395.png", record_pos=(-0.427, -0.945),
                                                   resolution=(1125, 2436))):
                                    touch(Template(r"tpl1720356867395.png", record_pos=(-0.427, -0.945),
                                                   resolution=(1125, 2436)))
                        time.sleep(2)
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Order_login.png"),
                                exist_ok=True)
                    snapshot(filename=f"{file_name}/{app_name}/Order_login.png")
                    if poco(nameMatches="Rewards.*"):
                        poco(nameMatches="Rewards.*").click()
                        time.sleep(2)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Rewards_logged.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/Rewards_logged.png")
                    """Rewards Center"""
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if poco(nameMatches="Rewards Center Order.*"):
                            poco(nameMatches="Rewards Center Order.*").click()
                            time.sleep(1)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Rewards_Center.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/Rewards_Center.png")
                            if exists(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436))):
                                touch(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436)))
                    else:
                        if poco(nameMatches="REWARDS CENTER Order.*"):
                            poco(nameMatches="REWARDS CENTER Order.*").click()
                            time.sleep(1)
                            if poco(nameMatches="Oops, your points are now at.*"):
                                os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Rewards_Center_no_point.png"),
                                            exist_ok=True)
                                snapshot(filename=f"{file_name}/{app_name}/Rewards_Center_no_point.png")
                                poco(name="Later").click()
                                time.sleep(0.5)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/Rewards_Center.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/Rewards_Center.png")
                            if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                                touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    time.sleep(1)
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if poco(nameMatches="Promotions Don't miss.*"):
                            poco(nameMatches="Promotions Don't miss.*").click()
                            time.sleep(0.5)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/promotion.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/promotion.png")
                            if exists(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436))):
                                touch(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436)))
                    else:
                        if poco(nameMatches="PROMOTIONS Don’t miss.*"):
                            poco(nameMatches="PROMOTIONS Don’t miss.*").click()
                            time.sleep(0.5)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/promotion.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/promotion.png")
                            if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                                touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    time.sleep(1)
                    if app_name == "Gongcha California" or app_name == "Gong Cha (DC, MD, VA)":
                        if poco(nameMatches="Gift Card Share Joy with Friends.*"):
                            poco(nameMatches="Gift Card Share Joy with Friends.*").click()
                            time.sleep(0.5)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/gift_card.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/gift_card.png")
                            if exists(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436))):
                                touch(
                                    Template(r"tpl1722846443329.png", record_pos=(-0.43, -0.942), resolution=(1125, 2436)))
                    else:
                        if poco(nameMatches="GIFT CARD Share Joy with Friends.*"):
                            poco(nameMatches="GIFT CARD Share Joy with Friends.*").click()
                            time.sleep(0.5)
                            os.makedirs(os.path.dirname(f"{file_name}/{app_name}/gift_card.png"),
                                        exist_ok=True)
                            snapshot(filename=f"{file_name}/{app_name}/gift_card.png")
                            if exists(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436))):
                                touch(Template(r"tpl1722844674794.png", record_pos=(-0.432, -0.915), resolution=(1125, 2436)))
                    time.sleep(1)
                    if poco(nameMatches="History.*"):
                        poco(nameMatches="History.*").click()
                        time.sleep(3)
                        os.makedirs(os.path.dirname(f"{file_name}/{app_name}/History_logged.png"),
                                    exist_ok=True)
                        snapshot(filename=f"{file_name}/{app_name}/History_logged.png")
                        time.sleep(0.5)
                    # log("关闭应用后台")
                    # if exists(Template(r"tpl1725528616315.png", record_pos=(0.399, 0.631), resolution=(1125, 2436))):
                    #     touch(Template(r"tpl1725528616315.png", record_pos=(0.399, 0.631), resolution=(1125, 2436)))
                    #     time.sleep(1)
                    #     if poco(nameMatches=f"card:{apk_name}.*"):
                    #         swipe([0.9, 0.8], [0.9, 0.1])
                except:
                    log(apk_name, desc="执行 " + app_name + " 失败")
                    os.makedirs(os.path.dirname(f"{file_name}/{app_name}/失败!!!!!!.png"),
                                exist_ok=True)
>                   snapshot(filename=f"{file_name}/{app_name}/失败!!!!!!.png")

test_cash.air\test_ios_ui.air\test_ios_ui.py:575: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
D:\ui\.venv\lib\site-packages\airtest\utils\logwraper.py:134: in wrapper
    res = f(*args, **kwargs)
D:\ui\.venv\lib\site-packages\airtest\core\api.py:295: in snapshot
    screen = G.DEVICE.snapshot(filename, quality=quality, max_size=max_size)
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:53: in wrapper
    return func(self, *args, **kwargs)
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:966: in snapshot
    data = self._neo_wda_screenshot()
D:\ui\.venv\lib\site-packages\airtest\core\ios\ios.py:951: in _neo_wda_screenshot
    value = self.driver.http.get('screenshot').value
D:\ui\.venv\lib\site-packages\wda\utils.py:47: in _inner
    return fn(*args, **kwargs)
D:\ui\.venv\lib\site-packages\wda\__init__.py:390: in _fetch
    response = httpdo(url, method, data, timeout)
D:\ui\.venv\lib\site-packages\wda\__init__.py:116: in httpdo
    return _unsafe_httpdo(url, method, data, timeout)
D:\ui\.venv\lib\site-packages\wda\__init__.py:131: in _unsafe_httpdo
    response = fetch(url, method, data, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

url = 'http+usbmux://c8da964b6373236c309909ee09b4db2b1f06a61b:8100/screenshot'
method = 'GET', data = None, timeout = 180.0

    def fetch(url: str, method="GET", data=None, timeout=None) -> HTTPResponseWrapper:
        """
        thread safe http request
    
        Raises:
            HTTPError
        """
        try:
            method = method.upper()
            conn = http_create(url)
            conn.timeout = timeout
            u = urlparse(url)
            urlpath = url[len(u.scheme) + len(u.netloc) + 3:]
    
            if not data:
                conn.request(method, urlpath)
            else:
                conn.request(method, urlpath, json.dumps(data), headers={"Content-Type": "application/json"})
            response = conn.getresponse()
            content = bytearray()
            while chunk := response.read(4096):
                content.extend(chunk)
            resp = HTTPResponseWrapper(content, response.status)
            return resp
        except Exception as e:
>           raise HTTPError(e)
E           wda.usbmux.exceptions.HTTPError: got an error message: {'MessageType': 'Result', 'Number': 3}

D:\ui\.venv\lib\site-packages\wda\usbmux\__init__.py:70: HTTPError

连接设备信息:

设备类型 设备型号 系统版本号 apk名称/下载链接 使用的wda版本 wda更新到最新
iOS iPhoneX iOS15.5 Appium/WebDriverAgent

提供最小可复现此BUG的代码:

如有需要  请联系邮箱
@lanchuanshuang lanchuanshuang changed the title iOS裕兴一段时间后莫名无响应,断开连接 iOS运行一段时间后莫名无响应,断开连接 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant