python实现安装当前路径所有apk

import os
import time

def install():
	filepath = os.getcwd()
	files = os.listdir(filepath)
	a = 1
	for file in files:
		if file.endswith('.apk'):
			os.popen("adb install \"{}\\{}\"".format(filepath, file))
			time.sleep(5)
			print("{}.........安装完成".format(file))
			a += 1
		else:
			continue
	print('\n总共安装了{}个APK\n'.format(a))
	os.system("@echo ****安装全部完成,请点击任意键退出控制台****")
	os.popen("pause 5")

install()
发布了3 篇原创文章 · 获赞 1 · 访问量 256

猜你喜欢

转载自blog.csdn.net/weixin_44546340/article/details/104900947