使用python编写批量卸载手机中安装的android应用脚本
更新时间:2014年07月21日 16:50:12 投稿:whsnow
该脚本的功能是卸载android手机中安装的所有第三方应用,主要是使用adb shell pm、adb uninstall 命令,需要的朋友可以参考下
该脚本的功能是卸载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."
相关文章
Python的Flask框架中使用Flask-SQLAlchemy管理数据库的教程
在Python中我们可以使用SQLAlchemy框架进行数据库操作,那么对应的在Flask框架中我们可以使用SQLAlchemy,下面我们就来看一下Python的Flask框架中使用Flask-SQLAlchemy管理数据库的教程2016-06-06
解决Python出现_warn_unsafe_extraction问题的方法
这篇文章主要为大家详细介绍了解决Python出现'_warn_unsafe_extraction'问题的方法,感兴趣的小伙伴们可以参考一下2016-03-03
matplotlib常见函数之plt.rcParams、matshow的使用(坐标轴设置)
这篇文章主要介绍了matplotlib常见函数之plt.rcParams、matshow的使用(坐标轴设置),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2021-01-01


最新评论