openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.26k stars 1.36k forks source link

atx创建成功之后,调用解锁API,抛异常 #913

Closed TesterZZY closed 2 months ago

TesterZZY commented 10 months ago

@codeskyblue @mingyuan-xia 各位大佬帮忙看下 问题:atx创建成功之后,调用解锁API,抛异常 具体log如下(请问这个问题如何处理):

tenforce: Couldn't set enforcing status to '0': Permission denied 2023-09-22 13:44:38.798 | INFO | process=851543 thread=140556423894848 | line:17 business.utils.initialization.connect_dev check_atx | 调用check_atx(), 检查atx的服务情况------> 2023-09-22 13:44:38.799 | INFO | process=851543 thread=140556423894848 | line:19 business.utils.initialization.connect_dev check_atx | 检查atx的服务情况------>还没有实例化过uiautomator2 2023-09-22 13:44:38.800 | INFO | process=851543 thread=140556423894848 | line:69 business.utils.initialization.connect_dev buildup_dev | 开始新建uiautomator2的ATX连接, 当前是第1次 [W 230922 13:44:38 init:218] [pid:851543] atx-agent has something wrong, auto recovering [D 230922 13:44:38 init:317] [pid:851543] [172.16.120.61:6724] device 172.16.120.61:6724 is online [I 230922 13:44:39 init:156] uiautomator2 version: 2.16.23 [D 230922 13:44:39 init:167] Shell: ('/data/local/tmp/atx-agent', 'server', '--stop') [D 230922 13:44:40 init:295] Real version: [0, 10, 0], Expect version: [0, 10, 0] [D 230922 13:44:40 init:167] Shell: ('/data/local/tmp/atx-agent', 'server', '--nouia', '-d', '--addr', '127.0.0.1:7912') [I 230922 13:44:40 init:350] Check atx-agent version [D 230922 13:44:40 init:359] Forward: local:tcp:9983 -> remote:tcp:7912 2023-09-22 13:44:40.614 | WARNING | process=851543 thread=140556423894848 | line:40 retry.api retry_internal | ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), retrying in 0.5 seconds... [D 230922 13:44:41 init:359] Forward: local:tcp:9983 -> remote:tcp:7912 [D 230922 13:44:41 init:362] atx-agent version 0.10.0 [D 230922 13:44:41 init:366] device wlan ip: wlan0 have no ip address [I 230922 13:44:41 init:879] [pid:851543] [172.16.120.61:6724] newCommandTimeout updated to 1h0m0s [D 230922 13:44:46 watcher:92] [pid:851543] watch check 2023-09-22 13:44:46.209 | INFO | process=851543 thread=140556423894848 | line:17 business.utils.initialization.connect_dev check_atx | 调用check_atx(), 检查atx的服务情况------> [D 230922 13:44:46 init:661] [pid:851543] [172.16.120.61:6724] kill process(ps): uiautomator [D 230922 13:44:46 init:661] [pid:851543] [172.16.120.61:6724] kill process(ps): uiautomator [D 230922 13:44:47 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 40.0s [D 230922 13:44:47 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 40.0s [D 230922 13:44:48 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 39.0s [D 230922 13:44:48 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 38.9s [D 230922 13:44:49 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 37.9s [D 230922 13:44:49 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 37.9s [D 230922 13:44:50 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 36.8s [D 230922 13:44:50 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 36.8s [D 230922 13:44:51 init:696] [pid:851543] [172.16.120.61:6724] show float window [D 230922 13:44:51 init:696] [pid:851543] [172.16.120.61:6724] show float window [D 230922 13:44:52 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 35.4s [D 230922 13:44:52 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 35.4s [D 230922 13:44:53 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 34.3s [D 230922 13:44:53 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 34.1s [D 230922 13:44:54 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 33.3s [D 230922 13:44:54 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 33.0s [D 230922 13:44:55 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 32.2s [D 230922 13:44:55 init:682] [pid:851543] [172.16.120.61:6724] uiautomator-v2 is starting ... left: 32.0s [I 230922 13:44:55 init:643] [pid:851543] [172.16.120.61:6724] uiautomator back to normal [I 230922 13:44:55 init__:643] [pid:851543] [172.16.120.61:6724] uiautomator back to normal 2023-09-22 13:44:55.994 | INFO | process=851543 thread=140556423894848 | line:23 business.utils.initialization.connect_dev check_atx | 检查atx的服务情况------>ConnectDevice.dev.info没有问题,所以ATX正常,ConnectDevice.dev.info = {'currentPackageName': 'com.android.launcher3', 'displayHeight': 1008, 'displayRotation': 0, 'displaySizeDpX': 1280, 'displaySizeDpY': 720, 'displayWidth': 1920, 'productName': 'rk3568_sgo_pax', 'screenOn': True, 'sdkInt': 32, 'naturalOrientation': True} 2023-09-22 13:44:55.994 | INFO | process=851543 thread=140556423894848 | line:84 business.utils.initialization.connect_dev buildup_dev | uiautomator2的ATX, 创建成功啦!!! [D 230922 13:44:58 watcher:92] [pid:851543] watch check [D 230922 13:45:00 watcher:92] [pid:851543] watch check [D 230922 13:45:02 watcher:92] [pid:851543] watch check [D 230922 13:45:04 watcher:92] [pid:851543] watch check [D 230922 13:45:06 watcher:92] [pid:851543] watch check [D 230922 13:45:09 watcher:92] [pid:851543] watch check [D 230922 13:45:11 watcher:92] [pid:851543] watch check [D 230922 13:45:13 watcher:92] [pid:851543] watch check [D 230922 13:45:15 watcher:92] [pid:851543] watch check [D 230922 13:45:17 watcher:92] [pid:851543] watch check [D 230922 13:45:20 watcher:92] [pid:851543] watch check [D 230922 13:45:22 watcher:92] [pid:851543] watch check [D 230922 13:45:24 watcher:92] [pid:851543] watch check 2023-09-22 13:45:26.168 | INFO | process=851543 thread=140556423894848 | line:56 business.utils.initialization.app_install install_app_language | start install setLanguage app 2023-09-22 13:45:26.168 | INFO | process=851543 thread=140556423894848 | line:53 business.utils.initialization.connect_dev buildup_dev | 调用buildup_dev方法----------------> setenforce: Couldn't set enforcing status to '0': Permission denied 2023-09-22 13:45:26.288 | INFO | process=851543 thread=140556423894848 | line:17 business.utils.initialization.connect_dev check_atx | 调用check_atx(), 检查atx的服务情况------> 2023-09-22 13:45:26.449 | INFO | process=851543 thread=140556423894848 | line:23 business.utils.initialization.connect_dev check_atx | 检查atx的服务情况------>ConnectDevice.dev.info没有问题,所以ATX正常,ConnectDevice.dev.info = {'currentPackageName': 'com.android.launcher3', 'displayHeight': 1008, 'displayRotation': 0, 'displaySizeDpX': 1280, 'displaySizeDpY': 720, 'displayWidth': 1920, 'productName': 'rk3568_sgo_pax', 'screenOn': True, 'sdkInt': 32, 'naturalOrientation': True} 2023-09-22 13:45:26.449 | INFO | process=851543 thread=140556423894848 | line:59 business.utils.initialization.connect_dev buildup_dev | 设备的ATX没有问题 [D 230922 13:45:26 watcher:92] [pid:851543] watch check [D 230922 13:45:26 watcher:92] [pid:851543] watch check [D 230922 13:45:28 watcher:92] [pid:851543] watch check [D 230922 13:45:28 watcher:92] [pid:851543] watch check [D 230922 13:45:30 watcher:92] [pid:851543] watch check [D 230922 13:45:30 watcher:92] [pid:851543] watch check [D 230922 13:45:33 watcher:92] [pid:851543] watch check [D 230922 13:45:33 watcher:92] [pid:851543] watch check [D 230922 13:45:35 watcher:92] [pid:851543] watch check [D 230922 13:45:35 watcher:92] [pid:851543] watch check [D 230922 13:45:37 watcher:92] [pid:851543] watch check [D 230922 13:45:37 watcher:92] [pid:851543] watch check [D 230922 13:45:39 watcher:92] [pid:851543] watch check [D 230922 13:45:39 watcher:92] [pid:851543] watch check [D 230922 13:45:42 watcher:92] [pid:851543] watch check [W 230922 13:45:42 init:218] [pid:851543] atx-agent has something wrong, auto recovering [I 230922 13:45:42 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(3.0s) [D 230922 13:45:42 watcher:92] [pid:851543] watch check [W 230922 13:45:42 init:218] [pid:851543] atx-agent has something wrong, auto recovering [I 230922 13:45:42 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(3.0s) [I 230922 13:45:43 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(2.0s) [I 230922 13:45:43 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(2.0s) [I 230922 13:45:44 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(1.0s) [I 230922 13:45:44 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(1.0s) [W 230922 13:45:46 init:218] [pid:851543] atx-agent has something wrong, auto recovering [I 230922 13:45:46 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(3.0s) [I 230922 13:45:47 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(2.0s) [I 230922 13:45:48 init:357] [pid:851543] [172.16.120.61:6724] device reconnecting, time left(1.0s) 2023-09-22 13:45:49.470 | INFO | process=851543 thread=140556423894848 | line:42 tests.mixture.per.conftest pytest_runtest_makereport | 跑分的pytest_runtest_makereport 2023-09-22 13:45:49.736 | WARNING | process=851543 thread=140556423894848 | line:167 tests.mixture.conftest pytest_runtest_makereport | 未设置上传信息,取消结果保存-->test_Antutu_Score_PER1 2023-09-22 13:45:49.737 | ERROR | process=851543 thread=140556423894848 | line:268 tests.conftest pytest_runtest_makereport | upgrade_os_by_fastboot = None get_per_args = (local('/var/lib/jenkins/workspace/CI_Code_Pull'), '/var/lib/jenkins/workspace/CI_Antutu_Child@12', '172.16.120.61:6724', 'L1600') cache = Cache()

def test_Antutu_Score_PER1(upgrade_os_by_fastboot, get_per_args, cache):  # upgrade_os_by_fastboot,
    # 获取当前开始时间戳
    start_time = int(time.time())
    project_folder, root_folder, serial_no, device_name = get_per_args

    device_name = get_convert_device_name(serial_no, device_name)

    # 安装set-language_signed.apk,并启动,自动设置为英文
    pkg_path = os.path.join(project_folder + "/business/Antutu/res", "set-language_signed.apk")
    print("pkg_path:" + str(pkg_path))
  SetLanguage.set_language(serial_no, pkg_path=pkg_path)

../CI_Code_Pull/tests/mixture/per/test_per_antutu.py:36:


../CI_Code_Pull/business/utils/initialization/set_language.py:25: in set_language InstallApp.install_app_language(serial_no, pkg_path) ../CI_Code_Pull/business/utils/initialization/app_install.py:59: in install_app_language InstallApp.install_app(serial_no, pkg_path=pkg_path) # 指定具体的路径 ../CI_Code_Pull/business/utils/initialization/app_install.py:26: in install_app ConnectDevice.dev.unlock() /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:1682: in unlock if not self.info['screenOn']: /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:448: in info return self.jsonrpc.deviceInfo(http_timeout=10) /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:479: in call return self.server._jsonrpc_retry_call(self.method, params, /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:486: in _jsonrpc_retry_call return self._jsonrpc_call(*args, kwargs) /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:513: in _jsonrpc_call res = self.http.post("/jsonrpc/0", /usr/local/lib/python3.8/dist-packages/requests/sessions.py:635: in post return self.request("POST", url, data=data, json=json, kwargs) /home/jenkins_home/.local/lib/python3.8/site-packages/uiautomator2/init.py:223: in request self.__client._prepare_atx_agent()


codeskyblue commented 2 months ago

fixed