21

I attempted to force uninstall in ADB, but failed:

$ adb shell pm uninstall -k org.openintents.filemanager
$ adb shell pm list packages -f | grep -i manager
package:/system/app/FileManager.apk=org.openintents.filemanager

What went wrong here? What can I do?

I used the internal application manager and there isn't an option to delete it.

1
  • 1
    When manually deleting application from /system remember to delete their corresponding data folder in /data/data/«identifier» There is also a track of the previous apk signature in /data/system/packages.xml that can prevent a reinstall of a rebuilt package with a different key.
    – anddam
    Commented May 2, 2012 at 14:53

4 Answers 4

21

Well, since the FileManager.apk package resides in a /system/app/ directory it is a system app. So the general way to remove it is:

adb shell
su
mount -o rw,remount /system
rm -rf /system/app/FileManager.apk
rm -rf /data/data/org.openintents.filemanager
mount -o ro,remount /system
exit
exit
4
  • 1
    When I run mount -o ro,remount /system, I get an error: Device or resource busy Commented Aug 1, 2016 at 13:07
  • 1
    @IgorG. I was able to resolve that by answering a prompt on the actual device.
    – Alex B
    Commented Sep 25, 2016 at 1:23
  • @AlexB Actually, no prompt occurs. This is a custom bootlegged phone, I guess. Commented Sep 25, 2016 at 23:03
  • Worked for me, Make sure the device has root access. Commented Oct 13, 2021 at 10:10
9

Edit: when I saw the comment to CommonsWare answer I did not realize it was the same as the asker... anyways, a little explanation may be useful for somebody.

As yourself commented, the easiest way to uninstall a system app is plainly to delete the .apk file. The adb install / adb uninstall commands are useful for regular apps, not system apps. Since this apk is located in /system/app, adb uninstall will not remove it.

You can use the command suggested (rm /system/app/YourApp.apk), but before the /system folder need to have write access. You will need to see how to remount /system in your specific device, try searchig for "android remount +rw /system" and your device).

Alternatively, you may use any app that can do both deletion and remounting and has root access, such as Root Explorer and Astro

2
  • thanks aleadam... plot thickens because the rm that i did removed the apk but, maybe, not the cache.. Im unable to install from the market .. that fails .. looks like i either have to clear the dalvik cache or just revert the entire ROM to a backup image... install at cmd line with adb ==> [INSTALL_FAILED_UPDATE_INCOMPATIBLE] ... unable to use market to download install ... get "installation error incompatible update" ... im on a custom rom and have a backup thats 2 weeks old and i may just revert to that.
    – Robert Rowntree
    Commented Apr 10, 2011 at 0:01
  • link what i should have done is in the 2nd post on this thread
    – Robert Rowntree
    Commented Apr 10, 2011 at 0:52
1

The 'Failure' problem has more to do with the adb shell appending a DOS line ending ^M (on CentOS Linux anyway). Put the list of applications to uninstall in a file and copy to the android device directly.

root@android:/root # dos2unix list-of-apps-to-uninstall.txt     
root@android:/root # for f in `cat list-of-apps-to-uninstall.txt` ; do echo $f; pm uninstall $f; done;
0

Tapemaster has made a Stack Overflow post which demonstrates the necessary trick.

Do this:

1. Install adb on your computer.

2. Root your phone.

3. Enter these commands into your computer:

adb shell
su
mount -o remount,rw /system
rm /system/app/UnwantedApp*
pm uninstall org.unwantedapp
exit
exit

The third command remounts /system read-write. The fourth command deletes the app's .apk and/or .odex files. The fifth command finishes the uninstallation.

In my experience: If you have already entered the the fourth command, then the fifth command will return Success. Otherwise, the fifth command will return Failure.

When entering the above commands, you must replace UnwantedApp with the app's real filename (without the extension), and org.unwantedapp with the app's real Java package name.

2
  • Can you justify the existence of your answer, when the majority of the content as well as the essence is already covered in an existing answer?
    – Firelord
    Commented Dec 15, 2015 at 18:41
  • @Firelord: 1. When "pm uninstall" reports "Success", it gives users confirmation which reassures them that they've done everything right. Sadly, rm -rf /data/data/org.openintents.filemanager doesn't provide such confirmation. 2. I speculate that pm uninstall might do more than just removing the app's data directory even in current Android versions. And definitely it might do more in Android versions which will be released a decade from now. Really, pm uninstall is the Right Way to uninstall packages. I urge you to choose the Right Way instead of trying to kludge things yourself. Commented Dec 15, 2015 at 18:57

You must log in to answer this question.