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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话