adb shell command from batch file

7.5k Views Asked by At

I have a .bat file that runs script for testing an app and printing the log to file i have all the commands i tested them manually.

Problem: after entering the command adb shell, the shell opens in the command prompt. I wrote the next commands that are entered in the shell with root@generic the commands aren't going through and it just waits at that spot.

what do i have to type in front of the commands to make them appear

example of what i have

cd directory of sdk
adb
adb shell
am instrumentation ... (this is the command that won't go through once the shell is open.

any help appreciated I've tried a few things with no success

1

There are 1 best solutions below

3
On BEST ANSWER

Just use the following line in your batch file:

adb shell am instrumentation

that will connect to the shell on the Android device and run the am command.