我想通过 Android Debug Bridge 向我的 Xiaomi Redmi Note 4G 发送命令,但每次我写这样的命令:
adb -s<3729749> <reboot-bootloader>
我收到回复:
< was unexpected at this time
看起来是什么问题?
答案1
adb -s<3729749> <reboot-bootloader>
< was unexpected at this time
就像它说的一样:你不应该指定<
。
当帮助说:
adb --help
...
-s <serial number>
- directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
...这意味着您必须指定序列号,不带<...>
。
可选参数括在方括号中[...]
。例如:
connect <host>[:<port>]
- connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
...你可以使用类似这样的方法:
connect 192.168.1.1
connect 192.168.1.1:5555 (same as above)
connect 10.0.0.1:123
以及:
adb reboot [bootloader|recovery]
- reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader
- reboots the device into the bootloader
...您可以选择指定给定的选项之一bootloader
或recovery
运行第一个命令。因此,您的完整命令应该是以下之一:
adb -s 3729749 reboot bootloader
adb -s 3729749 reboot-bootloader