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
I'm still curious to know why my approach was "suboptimal" and what could I have done better?
Wild guess since I'm not familiar with adb shell but bash: Quotation. Variables can not be inside ticks '...$VAR' but "...$VAR". Anything inside ticks is taken "as is", i.e. literally:
echo 'bundle name is $bundle'
vs.
echo "bundle name is $bundle"
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"