Running shell script in Android adb shell

后端 未结 2 687
闹比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:15

    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"
    

提交回复
热议问题