You are not logged in.
Pages: 1
hello everyone. i need to make a batch file out of these command but i can't seem to find a correct way to do this. i'm in need of your help.
i have a sh file that i send to phone's storage with adb shell and then execute it and all is fine. i just need to make a batch file out of this so that i don't have to send each command. here is the thing;
adb push myscript.sh /sdcard/myscript.sh
adb shell chmod 755 /sdcard/myscript.sh
adb shell
cd /sdcard/
./myscript.sh
now this don't work when i add these all in a batch file. works without batch file by sending command one by one.
after "adb shell" batch don't work, i think it is about changing directory within shell. so if anyone know can i make this in batch file would be really appreciated. thank you.
Offline
What OS are you running?
Offline
Try this:
adb push myscript.sh /sdcard/myscript.sh
adb shell chmod 755 /sdcard/myscript.sh
adb shell /sdcard/myscripts.sh
If myscript.sh is trying to do things with relative directories that rely on your working directory being /sdcard you might need to add something like this near the top of myscript.sh:
cd "$(dirname "${0}")"
Last edited by bluesxman (12 Jun 2019 08:54)
cmd | *sh | ruby | chef
Offline
Pages: 1