0

I'm using a bat file to run some ADB command. This is the content:

cd C:\AutoToolApx\AutoOffer\AutoOffer\bin\Debug
adb connect localhost:5555
adb -s localhost:5555 shell pm clear com.google.android.gms
adb -s localhost:5555 shell "su -c 'mount -o remount,rw none /sdcard;'
adb -s localhost:5555 push "C:\AutoToolApx\AutoOffer\AutoOffer\bin\Debug\data\bsinfor.txt" "/sdcard/bsinfor.txt"
adb -s localhost:5555 shell "su -c 'mount -o remount,rw none /data;busybox cp /sdcard/bsinfor.txt /data/bsinfor.txt;chmod 777 /data/bsinfor.txt;'"
exit

It used to print the output in the same window, as I expect. Now it prints the respond output in separated windows for each line of command:

enter image description here

This makes my program cannot work in the way I expected.

1 Answer 1

0

Edit your batch file, and surround each command with the following code:

cmd /k "..."

where ... is replaced with your command. For example:

cmd /k "adb connect localhost:5555"

cmd /k will execute this command and reuse the window.

1
  • It didn't work for me. New windows still be opened.
    – FlySoFast
    May 5, 2016 at 1:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .