ubuntu下安装pyadb踩坑记录
pyadb介绍
Google旗下的支持python操作adb相关的库
常见的关于adb直接操作对应的命令都支持
pyadb安装
正常安装命令
1 pip install adb
然后发现会少各种依赖报错
报错:SWIG/_m2crypto.i:43: Error: Unable to find ‘openssl/opensslv.h’
1 sudo apt-get install libssl-dev
1 apt install libusb-dev
2 apt install swig libssl-dev
报错:SWIG/_m2crypto_wrap.c:3554:10: fatal error: openssl/err.h: No such file or directory
1 apt install openssl-devel
各种依赖安装好后,直接install
1 root@ubuntu:/home/lixf6# pip install adb
2 Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
3 /usr/share/python-wheels/urllib3-1.26.2-py2.py3-none-any.whl/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'mirrors.aliyun.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
4 Collecting adb
连接上设备直接操作查看:
1 root@ubuntu:/home/lixf6# pyadb devices
2 8KE0219730006796 device