Use Python to write scripts to bulk uninstall Android apps

Source: Internet
Author: User

The function of this script is to uninstall all third-party apps installed in Android phone, mainly using adb shell pm, adb Uninstall command, so the premise is to use the environment variable of ADB, the following code:

1 #!/usr/bin/env python2 3 ImportOS4 5 defUninstall ():6Os.popen ("adb wait-for-device")7     Print "Start Uninstall ..."8      forPackagesinchOs.popen ("adb shell pm list packages-3"). ReadLines ():9PackageName = Packages.split (":") [-1].splitlines () [0]TenOs.popen ("adb Uninstall"+PackageName) One         Print "Uninstall"+ PackageName +"successed." A  - if __name__=="__main__": - Uninstall () the     Print " " -     Print "All the third-party applications uninstall successed."

Use Python to write scripts to bulk uninstall Android apps

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.