【Ubuntu安装,ATX基于uiautomator2】之安装步骤

Ubuntu系统下安装uiautomator2步骤:网址:yii666.com

1、安装命令:

pip install --upgrade --pre uiautomator2

但是报错:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fd8i2dr1/uiautomator2/文章来源地址:https://www.yii666.com/article/764094.html

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

后经大神提示后原因是Python版本问题,原版本是3.5.2,利用pyenv进行版本切换或升级

pyenv命令:

①安装:

pyenv install 3.6.1

②安装完后刷新:

pyenv rehash

③查看已安装版本:

pyenv versions
* system (set by /home/seisman/.pyenv/version)
3.6.1

④指定版本:

pyenv global 3.6.1

⑤切回原来版本:

pyenv global system

最后再执行安装命令,安装成功:

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

2、Deploy associated daemons to a device    电脑连接上一个手机或多个手机, 确保adb已经添加到环境变量中,执行下面的命令会自动安装本库所需要的设备端程序:uiautomator-server 、atx-agent、openstf/minicap、openstf/minitouch

# init 所有的已经连接到电脑的设备
python -m uiautomator2 init
但是报错:WARNING - No avaliable android devices detected.
【Ubuntu安装,ATX基于uiautomator2】之安装步骤

提示:警告-没有可检测的Android设备被检测到。

返回手机打开USB调试模式。

最后再执行安装命令,安装成功如下:

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

出现success表示成功。

3、Install weditor(UI Inspector)文章来源地址https://www.yii666.com/article/764094.html网址:yii666.com<

因为uiautomator是独占资源,所以当atx运行的时候uiautomatorviewer是不能用的,为了减少atx频繁的启停,我们开发了基于浏览器技术的weditor UI查看器。https://github.com/openatx/weditor

安装方法

pip install --pre -U weditor

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

安装成功。

4、

命令行启动 python -m weditor 会自动打开浏览器,输入设备的ip或者序列号,点击Connect即可。

具体参考文章:浅谈自动化测试工具python-uiautomator2

但是报错:

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

没办法,后来我是手动输入地址:http://localhost:17310/,链接成功,输入设备号

设备号通过:adb devices  命令查询。

然后打开手机软件后,输入设备号并点击weditor中的【Reload】蓝色按钮刷新,页面就出来。文章地址https://www.yii666.com/article/764094.html

【Ubuntu安装,ATX基于uiautomator2】之安装步骤

版权声明:本文内容来源于网络,版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。文本页已经标记具体来源原文地址,请点击原文查看来源网址,站内文章以及资源内容站长不承诺其正确性,如侵犯了您的权益,请联系站长如有侵权请联系站长,将立刻删除

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信图片_20190322181744_03.jpg

微信扫一扫打赏

请作者喝杯咖啡吧~

支付宝扫一扫领取红包,优惠每天领

二维码1

zhifubaohongbao.png

二维码2

zhifubaohongbao2.png