adb wait-for-device和adb wait-for-devices之间有什么区别吗?
我使用了两个命令来等待设备启动:
adb wait-for-device和adb wait-for-devices。
两者似乎都在等待设备启动,我发现它们的行为没有任何区别。他们的行为有什么区别吗?
添加有关我所做操作的更多信息:
所以这是我在android上所做的文档我使用adb等待设备,但是有时在使用此命令时,我将其用作adb等待设备,如您所见,我在末尾添加了一个额外的's',但该命令仍然有效。所以我在想为什么等待设备和等待设备都起作用! android为什么要提供两个相同的命令?
There are two commands that I used wait for a device to come up:
adb wait-for-device and adb wait-for-devices.
Both seem to wait for a device to boot up, I din't find any difference in their behaviour. Is there any difference in their behaviour?
Adding more information on what I did:
So here is what I did, from the android documentation I used adb wait-for-device but then sometime while using this command I used it as adb wait-for-devices, as you can see I added a extra 's' at the end, but the command still worked. So I was thinking why does both wait-for-device and wait-for-devices work! Why would android provide two commands for the same?
这就是 adb
处理命令:
/* handle wait-for-* prefix */
if (!strncmp(argv[0], "wait-for-", strlen("wait-for-"))) {
const char* service = argv[0];
if (!strncmp(service, "wait-for-device", strlen("wait-for-device"))) {
if (ttype == kTransportUsb) {
service = "wait-for-usb";
} else if (ttype == kTransportLocal) {
service = "wait-for-local";
} else {
service = "wait-for-any";
}
}
因此任何以开头的字符串等待设备
将具有相同的效果
So any string starting with wait-for-device
would have the same effect