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

George Profenza picture George Profenza · Jul 9, 2013 · Viewed 83.1k times · Source

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 ?

Answer

Frxstrem picture Frxstrem · Jul 9, 2013

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.