I can uninstall an app on the device from my computer using adb uninstall
,
but I\'d like to do the same with a script on the actual device.
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.
If you have an rooted android device then you can easily uninstall pre-installed apps from your device. My OnePlus device is rooted with Magisk manager.
Rooting an Android device gives you admin privileges towards your device and so you can easily install or uninstall any system application.
However, command line method also works most of the time. I have tested adb method on MIUI device for removing bloatware.
You can follow stackoverflow read this thread....
ADB command: pm uninstall -k <package_name>