参考:UiAutomator python-uiautomator2-atx 踩坑记录 (关于 python 与 uiautomator2 版本兼容)

链接:https://testerhome.com/topics/18642

 

Python版本是3.7.0,uiautomator2版本为2.5.8.dev1

[I 200224 15:18:22 init:131] uiautomator2 version: 2.5.8.dev1

python -m uiautomator2 init报错:requests.exceptions.ConnectionError

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='github-mirror.open.netease.com', port=443): Max retries exceeded with url: /openatx/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/x86/lib/android-22/minicap.so (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000024A20790B70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

解决办法:

看了参考文章,想到更换软件版本

我把uiautomator2版本换成我另一台主机正常使用版本:

pip show uiautomator2
Name: uiautomator2
Version: 2.5.4
Summary: Python Wrapper for Google Android UiAutomator2 test tool
Home-page: https://github.com/openatx/uiautomator2
Author: codeskyblue
Author-email: codeskyblue@gmail.com
License: MIT
Location: d:\program\anaconda3\lib\site-packages
Requires: Pillow, humanize, six, adbutils, lxml, logzero, requests, retry, Deprecated, progress, whichcraft
Required-by: weditor

再python -m uiautomator2 init,问题解决

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐