Prashant Mishra Prashant Mishra - 1 month ago 22
Bash Question

Batch script for adb commands

i am writing batch script for executing adb commands but while executing "SU" commands only the first commands runs "adb shell" and stops
as the script is typing all the commands very fast and not waiting for previous command to run completely so that next command can be entered into the shell window that is "su" example of code is below

:lckscreen
adb shell
su
rm /data/system/gesture.key
rm /data/system/*.key
exit
exit
pause
goto menu4


i also tried

adb shell & su


but still same Result

shell@Samsung_s4:/ $


please help

Answer

Please try

adb shell "su -c 'rm /data/system/gesture.key'"
adb shell "su -c 'rm /data/system/*.key'"

and see the question in How to use su command over adb shell?

Comments