如何ADB"重启下载"在bash脚本?

时间:2015-06-23 21:07:25

标签: bash adb command-line-parsing

我想同时重启许多Android设备以下载模式。

以下两项工作均来自命令行:

    adb reboot
    adb reboot download

以下bash脚本也有效:

adb devices | while read line
do
    if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
    then
        device=`echo $line | awk '{print $1}'`
        echo "$device $@ ..."
        adb -s $device "reboot" &
    fi
done

然而,当我更换' reboot'使用' reboot download',该脚本仅提供ADB使用说明:

user@user /home 
$ ./rebootToDownload.bsh 
29f7654c  ...

user@user /home 
$ Android Debug Bridge version 1.0.31

 -a                            - directs adb to listen on all interfaces for a connection
 -d                            - directs command to the only connected USB device
                                 returns an error if more than one USB device is present.
 -e                            - directs command to the only running emulator.
 ...

有人可以解释为什么&ADB重启'成功执行,但不是'ADB重启下载'?

有什么方法吗?

感谢任何帮助。

0 个答案:

没有答案