Python模块ADB的, 已经 pyadb

Python模块ADB的使用指南_笔记大全_设计学院 (python100.com)

复制代码
pip install adb

Python 调用ADB_python 调用adb命令_实相实相的博客-CSDN博客

Python ADB.shell_command Examples, pyadb.ADB.shell_command Python Examples - HotExamples

Gitee 极速下载/PyADB - 码云 - 开源中国

复制代码
# creates the ADB object
    adb = ADB()
    # IMPORTANT: You should supply the absolute path to ADB binary
    if adb.set_adb_path('/usr/bin/adb') is True:
        print("Version: %s" % adb.get_version())
    else:
        print("Check ADB binary path")

    apps = adb.shell_command("pm list packages")
    for app in apps:
        path = adb.shell_command("pm path {}".format(app.split(':')[1]))
        print("{}: {}".format(app, path))

python在adb shell环境下执行命令 - wztshine - 博客园 (cnblogs.com)

复制代码
import subprocess

obj = subprocess.Popen('adb -s 8BHX1B399 shell', stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)
out,err = obj.communicate(input='cd /data/;ls;find . -type d'.encode())   # 通过communicate传递数据,返回(stdout,stderr)
print(out.decode())

import os
import subprocess

cmd = 'adb -s 8BHX1B399 shell "cd /data;ls"'   # 将你要执行的子命令用引号写出来,命令间以';'分割
result = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
output, error = result.communicate(timeout=600)
print(output.decode())

Python 在Python中使用subprocess的communicate函数实现多个输入和输出|极客教程 (geek-docs.com)

相关推荐
AIOT魔法师2 天前
修复Android studio的adb无法连接手机问题
adb·智能手机·android studio
gamers2 天前
rock linux 9 安装mysql 5.7.44
linux·mysql·adb
独行soc3 天前
2025年渗透测试面试题总结-67(题目+回答)
网络·python·安全·web安全·网络安全·adb·渗透测试
sibylyue3 天前
MySQLTransactionRollbackException
adb
快乐觉主吖3 天前
adb的常用命令
adb
好名字更能让你们记住我3 天前
MYSQL数据库初阶 之 MYSQL用户管理
linux·数据库·sql·mysql·adb·数据库开发·数据库架构
哥哥还在IT中3 天前
mysql分库分表数据量核查问题
数据库·mysql·adb
paid槮3 天前
MySql基础:数据类型
android·mysql·adb
独行soc3 天前
2025年渗透测试面试题总结-66(题目+回答)
java·网络·python·安全·web安全·adb·渗透测试
残影飞雪4 天前
如何在 Debian 12 上安装 MySQL
mysql·adb·debian