Search code examples
androidshelladb

Shell script does not work when pushed to device


What i want

I want to remove some google Apps with a shell script, started from my windows client using adb.

What is the problem

When I use following command in command prompt using adb / shell it works.

pm uninstall --user 0 com.google.android.apps.maps

But when I put the same command into a shell script, push it to my phone and try to run it - it gives the app is not installed error!


Solution

  • I solved the problem with a little workaround. I just start the pm uninstall command also from the batch and do not push it to the device.

    Like this: (uninstall.bat)

    adb shell pm uninstall --user 0 com.google.android.gm
    adb shell pm uninstall --user 0 com.google.android.apps.maps
    adb shell pm uninstall --user 0 com.google.android.youtube
    pause