is there a way to run adb shell commands via windows?
I would like to run a batch script such as this
adb shell mount -o rw,remount /system exit
Currently when i run the batch script it only runs the first command
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
Wrong syntax :)
adb shell "mount -o rw,remount /system"
would do in your case (i.e. passing the command you want to run on the device to
adb shell in double-quotes; the "exit" is not needed here as it is "implied"), provided your device's ADB daemon runs in root mode. You can even run multiple commands at once this way, e.g.:
adb shell "mount -o rw,remount /system && echo 127.0.0.1 foobar.com > /system/etc/hosts && mount -o ro,remount /system"
Commands connected with
&& here, meaning: only execute the next command if the previous one succeeded. If you don't want that dependency, use
; instead to connect them.
For how to use a multi-line command (so called "HEREDOC") with Windows (or any other OS), SuperUser is the better place to ask (in case the Wikipedia entry is not sufficient ;)