批量安装/卸载手机apk--python语言
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了批量安装/卸载手机apk--python语言相关的知识,希望对你有一定的参考价值。
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语言的主要内容,如果未能解决你的问题,请参考以下文章