AndroidNovice21 AndroidNovice21 - 1 month ago 11
Android Question

adb shell command from batch file

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

Answer Source

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.