Full disclosure: I'm new to both Android development and Linux.
I have a shell script to loop through connected devices and perform ADB commands.
while read -r udid device usb product model device2; do
echo ""
echo $usb
echo ""
# REBOOT
adb -s "$usb" reboot-bootloader
# UNLOCK OEM
fastboot -s "$usb" oem unlock
# REBOOT
fastboot -s "$usb" reboot
done < <(adb devices -l | sed "1d; $ d")
This works great on one device. If I have two devices the first device will work but the second will hang at:
< waiting for usb:1-2 >
On three devices the first device will reboot to bootloader and then hang like I said above.
The endgame here is to execute this script (and several others) on as many android devices as possible at one time. This loop works great for pushing our APK to each device but to unlock the bootloader, to run this code AND for another script to boot to recovery it hangs.
I found this stackoverflow and made sure my udev rules were correct. As I said it works on one device no problem.
I also referenced this post that recommended I change my while loop to a for loop and that has the same result.
These devices are Mediatek phones running Android 6.0 Marshmallow. So all the serial number are the same (0123456789ABCDEF) if that's an issue. I'm using Ubuntu 8.10.