######################python 代码实现
#!usr/bin/python
# -*- coding:utf-8 -*-
# Author:joy
# 把指定目录的apk安装到所有连接设备中
import os
import subprocess
import threading
import re
import time
apk_path = "D:\\yjapk\\jiagu_sign.apk"
def excute(cmd):
subprocess.Popen(cmd, shell=True)
def get_conn_dev():
connectdeviceid = []
p = os.popen('adb devices')
outstr = p.read()
print(outstr)
connectdeviceid = re.findall(r'(\w+)\s+device\s', outstr)
return connectdeviceid
def main():
connectdevice = get_conn_dev()
commands = []
for device in connectdevice:
cmd = "adb -s %s install -r %s" % (device,apk_path)
commands.append(cmd)
threads = []
threads_count = len(commands)
for i in range(threads_count):
t = threading.Thread(target = excute,
Python脚本批量安装Android 应用(附上shell脚本批量安装应用)
最新推荐文章于 2024-07-14 22:49:50 发布
本文介绍如何使用Python脚本配合Shell命令批量安装Android应用。通过adb工具,结合设备编号,实现安装包的自动化安装过程。
订阅专栏 解锁全文
16万+

被折叠的 条评论
为什么被折叠?



