折腾:
【未解决】试试ATX的WiFi无线而不用有线USB数据线能否调试安卓设备
看到官网uiautomator2最新版已经是:2.12.0了。
去看看本地u2版本
xxx@xxx ~/dev/xx/crawler/appAutoCrawler/AppCrawler master ● pip show uiautomator2 Name: uiautomator2 Version: 2.5.3 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: /Users/xxx/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/python3.8/site-packages Requires: progress, six, requests, adbutils, Pillow, whichcraft, retry, Deprecated, lxml, humanize, logzero Required-by: weditor
已经很旧版本了。
-》感觉需要去升级最新版了?
刚才搞错了,没进虚拟环境。
现在进去后,发现版本还是很新的:
xxx@xxx ~/dev/xxx/crawler/appAutoCrawler/AppCrawler master ● source venv/bin/activate (venv) xxx@xxx ~/dev/xxx/crawler/appAutoCrawler/AppCrawler master ● pip freeze > requirements.txt (venv) xxx@xx ~/dev/xx/crawler/appAutoCrawler/AppCrawler master pip show uiautomator2 Name: uiautomator2 Version: 2.11.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: /Users/xxx/dev/xx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages Requires: logzero, whichcraft, progress, retry, lxml, Deprecated, packaging, six, adbutils, requests, cached-property, Pillow Required-by: weditor
不过那也还是:值得升级到最新版2.12.0
pip upgrade
pip 升级包
pip install --upgrade 要升级的包名
去试试
(venv) xxx@xxx ~/dev/xx/crawler/appAutoCrawler/AppCrawler master pip install --upgrade uiautomator2 Collecting uiautomator2 Downloading uiautomator2-2.12.0.tar.gz (678 kB) |████████████████████████████████| 678 kB 437 kB/s Requirement already satisfied, skipping upgrade: six in ./venv/lib/python3.8/site-packages (from uiautomator2) (1.14.0) Requirement already satisfied, skipping upgrade: requests in ./venv/lib/python3.8/site-packages (from uiautomator2) (2.22.0) Requirement already satisfied, skipping upgrade: whichcraft in ./venv/lib/python3.8/site-packages (from uiautomator2) (0.6.1) Requirement already satisfied, skipping upgrade: logzero~=1.5 in ./venv/lib/python3.8/site-packages (from uiautomator2) (1.5.0) Requirement already satisfied, skipping upgrade: progress~=1.3 in ./venv/lib/python3.8/site-packages (from uiautomator2) (1.5) Requirement already satisfied, skipping upgrade: retry~=0.9 in ./venv/lib/python3.8/site-packages (from uiautomator2) (0.9.2) Requirement already satisfied, skipping upgrade: adbutils<1.0,>=0.8.2 in ./venv/lib/python3.8/site-packages (from uiautomator2) (0.8.2) Requirement already satisfied, skipping upgrade: Deprecated~=1.2.6 in ./venv/lib/python3.8/site-packages (from uiautomator2) (1.2.7) Requirement already satisfied, skipping upgrade: Pillow in ./venv/lib/python3.8/site-packages (from uiautomator2) (7.0.0) Requirement already satisfied, skipping upgrade: lxml>=4.3 in ./venv/lib/python3.8/site-packages (from uiautomator2) (4.5.0) Requirement already satisfied, skipping upgrade: cached-property<2.0,>=1.5.1 in ./venv/lib/python3.8/site-packages (from uiautomator2) (1.5.1) Requirement already satisfied, skipping upgrade: packaging~=20.3 in ./venv/lib/python3.8/site-packages (from uiautomator2) (20.4) Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./venv/lib/python3.8/site-packages (from requests->uiautomator2) (1.25.8) Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in ./venv/lib/python3.8/site-packages (from requests->uiautomator2) (2019.11.28) Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in ./venv/lib/python3.8/site-packages (from requests->uiautomator2) (3.0.4) Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in ./venv/lib/python3.8/site-packages (from requests->uiautomator2) (2.8) Requirement already satisfied, skipping upgrade: decorator>=3.4.2 in ./venv/lib/python3.8/site-packages (from retry~=0.9->uiautomator2) (4.4.1) Requirement already satisfied, skipping upgrade: py<2.0.0,>=1.4.26 in ./venv/lib/python3.8/site-packages (from retry~=0.9->uiautomator2) (1.8.1) Requirement already satisfied, skipping upgrade: deprecation<3.0,>=2.0.6 in ./venv/lib/python3.8/site-packages (from adbutils<1.0,>=0.8.2->uiautomator2) (2.0.7) Requirement already satisfied, skipping upgrade: apkutils2<2.0,>=1.0.0 in ./venv/lib/python3.8/site-packages (from adbutils<1.0,>=0.8.2->uiautomator2) (1.0.0) Requirement already satisfied, skipping upgrade: wrapt<2,>=1.10 in ./venv/lib/python3.8/site-packages (from Deprecated~=1.2.6->uiautomator2) (1.11.2) Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in ./venv/lib/python3.8/site-packages (from packaging~=20.3->uiautomator2) (2.4.6) Requirement already satisfied, skipping upgrade: pyelftools in ./venv/lib/python3.8/site-packages (from apkutils2<2.0,>=1.0.0->adbutils<1.0,>=0.8.2->uiautomator2) (0.26) Requirement already satisfied, skipping upgrade: xmltodict in ./venv/lib/python3.8/site-packages (from apkutils2<2.0,>=1.0.0->adbutils<1.0,>=0.8.2->uiautomator2) (0.12.0) Requirement already satisfied, skipping upgrade: cigam in ./venv/lib/python3.8/site-packages (from apkutils2<2.0,>=1.0.0->adbutils<1.0,>=0.8.2->uiautomator2) (0.0.3) Building wheels for collected packages: uiautomator2 Building wheel for uiautomator2 (setup.py) ... done Created wheel for uiautomator2: filename=uiautomator2-2.12.0-py3-none-any.whl size=215523 sha256=4122a7c43fc0421c326f6c1f319e37bb85f1204e58d1d4800432d3537f3c03c3 Stored in directory: /Users/xxx/Library/Caches/pip/wheels/73/da/21/5d8d75c4ecef1827584578c00fc603fb67cb36432ada9d478d Successfully built uiautomator2 Installing collected packages: uiautomator2 Attempting uninstall: uiautomator2 Found existing installation: uiautomator2 2.11.4 Uninstalling uiautomator2-2.11.4: Successfully uninstalled uiautomator2-2.11.4 Successfully installed uiautomator2-2.12.0
确认版本:
(venv) xxx@xxx ~/dev/xxx/crawler/appAutoCrawler/AppCrawler master pip show uiautomator2 Name: uiautomator2 Version: 2.12.0 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: /Users/xxx/dev/xxx/crawler/appAutoCrawler/AppCrawler/venv/lib/python3.8/site-packages Requires: adbutils, requests, Pillow, packaging, whichcraft, Deprecated, lxml, cached-property, progress, logzero, six, retry Required-by: weditor
是最新的2.12.0了。
转载请注明:在路上 » 【已解决】Mac中Python的virtualenv中用pip升级uiautomator2到最新版