
Ich verwende eine Bat-Datei, um einen ADB-Befehl auszuführen. Dies ist der Inhalt:
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
Wie erwartet wurde die Ausgabe im selben Fenster gedruckt. Jetzt wird die Antwortausgabe in separaten Fenstern für jede Befehlszeile gedruckt:
Dies führt dazu, dass mein Programm nicht wie erwartet funktioniert.
Antwort1
Bearbeiten Sie Ihre Batchdatei und umgeben Sie jeden Befehl mit dem folgenden Code:
cmd /k "..."
wobei ... durch Ihren Befehl ersetzt wird. Beispiel:
cmd /k "adb connect localhost:5555"
cmd /k führt diesen Befehl aus und verwendet das Fenster erneut.