This script is used to uninstall all third-party applications installed on android phones. it mainly uses the adbshellpm and adbuninstall commands, if you need this script, you can refer to it to uninstall all third-party applications installed on your android phone. the script mainly uses the adb shell pm and adb uninstall commands, therefore, you must configure the environment variables of adb. the following code is used:
#! /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."