通过批处理脚本自动执行adb命令

时间:2015-09-18 08:49:31

标签: shell batch-file scripting adb

有没有办法通过Windows运行adb shell命令?

我想运行一个像这样的批处理脚本

Math.max(4, 2, 6, 1, 3, 7, 5, 3);

目前,当我运行批处理脚本时,它只运行第一个命令adb shell mount -o rw,remount /system exit

任何其他方法也可以

1 个答案:

答案 0 :(得分:1)

问题是adb shell从stdin(例如键盘)获取其输入,因此它不会看到后续命令。相反,只要adb退出,这些就会在本地计算机上运行。

adb shell takes a shell command as its argument,所以你应该可以这样做:

adb shell "mount -o rw,remount /system"

在这种情况下,最后的exit是不必要的,因为adb会在命令完成后立即退出。

相关问题