
일부 ADB 명령을 실행하기 위해 bat 파일을 사용하고 있습니다. 내용은 다음과 같습니다.
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
예상대로 동일한 창에서 출력을 인쇄하는 데 사용되었습니다. 이제 각 명령 줄에 대해 별도의 창에 응답 출력을 인쇄합니다.
이로 인해 내 프로그램이 예상한 대로 작동하지 않게 됩니다.
답변1
배치 파일을 편집하고 각 명령을 다음 코드로 묶습니다.
cmd /k "..."
여기서 ...는 명령으로 대체됩니다. 예를 들어:
cmd /k "adb connect localhost:5555"
cmd /k는 이 명령을 실행하고 창을 재사용합니다.