批量卸载android应用的脚本 使用python编写批量卸载手机中安装的android应用脚本

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

批量卸载android应用的脚本 使用python编写批量卸载手机中安装的android应用脚本

  2021-03-19 我要评论
想了解使用python编写批量卸载手机中安装的android应用脚本的相关内容吗,在本文为您仔细讲解批量卸载android应用的脚本的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:批量卸载,android应用,下面大家一起来学习吧。

该脚本的功能是卸载android手机中安装的所有第三方应用,主要是使用adb shell pm、adb uninstall 命令,所以使用的前提是需要配好adb的环境变量,下面上代码:

#!/usr/bin/env python 

import os 

def uninstall(): 
os.popen("adb wait-for-device") 
print "start uninstall..." 
for packages in os.popen("adb shell pm list packages -3").readlines(): 
packageName = packages.split(":")[-1].splitlines()[0] 
os.popen("adb uninstall " + packageName) 
print "uninstall " + packageName + " successed." 

if __name__ == "__main__": 
uninstall() 
print " " 
print "All the third-party applications uninstall successed." 

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们