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

posted on   帅胡  阅读(235)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示