2015年2月9日 星期一

How to remove Android Apps through ADB

ADB is a toolkit provided by Google to access your Android device from your desktop.  Before reading the steps below, we assume you know how to install a non-market application through ADB (if not, please see: How to Install Non-Market .Apk Application on an Android Phone).
The few reasons you may want to remove the apk via ADB are the following:
  • Removing the application via Manage Applications appears to not work perhaps because the developer packaged the application poorly.
  • Convenience: if you are already at the adb shell and have run into an installation problem because the application already exists.
  • Geekness: you wanna be just too cool.
The sequence of command lines will walk you through how to remove an app using ADB.  We also warn that the following steps can harm your phone.  Do not remove APKs flippantly.
  1. Connect your phone to the computer and successfully log into the adb shell.  (refer to theadb setup)
  2. su (Login as root)
  3. mount -o remount,rw -t rfs /dev/stl5 /system (the ‘rw’ allows you to modify the system directory.)
  4. rm -r /system/app/[AppName].apk (or apps)
  5. … You may repeat #4 for other apps.
  6. mount -o remount,ro -t rfs /dev/stl5 /system (Set system to read only, ‘ro’, to prevent malicious activity.)
If you need to look up the AppName:
  1. cd /system/app
  2. ls *.apk (This will provide you with a list of APKs)
If you need to backup your app:
  1. cat [AppName].apk > /sdcard/[AppName].apk (This will backup the APK specified to your SD Card. Do this if you are unsure if it is safe to remove.)

沒有留言:

張貼留言