Running shell script in Android adb shell

后端 未结 2 692
闹比i
闹比i 2021-01-21 17:56

I\'m trying to create a script to find and remove my app from the Android emulator through the adb shell.

This is what I\'ve got:

adb shell \"
cd data/ap         


        
2条回答
  •  野性不改
    2021-01-21 18:32

    You should not really go through the /data/app folder. If you want to uninstall multiple packages with names matching the com.mycompany pattern with a single adb command use:

    adb shell "pm list packages com.mycompany | cut -c9- | xargs -n 1 sh /system/bin/pm uninstall"
    

提交回复
热议问题