Use python to compile a script to uninstall android apps installed on mobile phones in batches

Source: Internet
Author: User
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."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.