Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall an android app from command line on the device

I can uninstall an app on the device from my computer using adb uninstall <package_name>, but I'd like to do the same with a script on the actual device.

I've also tried running an android.intent.action.DELETE intent using am but it prompts the user for confirmation.

Given that the device is rooted, is it possible to run a command on the device to uninstall an app without requiring user action/confirmation ?

like image 424
George Profenza Avatar asked Jul 09 '13 19:07

George Profenza


People also ask

How do I uninstall a program using command prompt?

In the Command prompt, type in 'wmic,' and hit Enter. Type in 'product get name' in the cmd and hit Enter. This will pull up the product list on your PC. Make sure you replace "name-of-the-program" with an actual program you'd like to remove, and the app will be removed easily.

How do you uninstall an app that has no uninstall option?

If you can't find the option yourself, use your phone's built-in search function in the Settings menu. See if the app in question is marked with a tick. If so, disable it. Now go to your apps manager – the application should now be uninstallable.


1 Answers

Trying using the pm command:

pm uninstall <package_name> 

or

pm uninstall -k <package_name> 

The -k flag keeps the data and cache directories after the package is removed.

I haven't tested this myself, but I don't think this should show a warning message.

like image 179
Frxstrem Avatar answered Sep 22 '22 17:09

Frxstrem