首页 > 移动平台 > 详细

批量安装/卸载手机apk--python语言

时间:2017-06-22 18:08:43      阅读:389      评论:0      收藏:0      [点我收藏+]
import os
import time

filedir = "D:\\app"

def install():
files = os.listdir(filedir)
for file in files:
text = os.popen("adb install -r D:\\app\\"+ file)
print "adb install "+file
print text.read()


def uninstall():
for packages in os.popen("adb shell pm list package -3").readlines():
packageName = packages.split(":")[-1].splitlines()[0]
if "google" not in packageName:
text = os.popen("adb uninstall " + packageName)
print "uninstall "+ packageName
print text.read()

def main():
install()
uninstall()


if __name__ == ‘__main__‘:
main()

批量安装/卸载手机apk--python语言

原文:http://www.cnblogs.com/asin-huang/p/7066307.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!