标签:port pac 卸载 批量 shell 批量安装 listdir read pre
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()
标签:port pac 卸载 批量 shell 批量安装 listdir read pre
原文地址:http://www.cnblogs.com/asin-huang/p/7066307.html