Skip to content

Instantly share code, notes, and snippets.

@wvdschel
Created January 14, 2013 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvdschel/4529075 to your computer and use it in GitHub Desktop.
Save wvdschel/4529075 to your computer and use it in GitHub Desktop.
#!/bin/bash
ADB_DEVICE_COUNT=`adb devices | wc -l`
ADB_DEVICE_COUNT=`expr $ADB_DEVICE_COUNT - 2`
if [ $ADB_DEVICE_COUNT -gt 0 ]
then
echo rebooting into fastboot
adb reboot bootloader
fi
#cp /cygdrive/a/qualcomm/out/target/product/msm8960/*.img .
echo Waiting for fastboot to list exactly one device
while true
do
FB_DEVICE_COUNT=`fastboot devices | wc -l`
#FB_DEVICE_COUNT=`expr $DEVICE_COUNT`
if [ $FB_DEVICE_COUNT -eq 1 ]
then
echo Device found
break
fi
sleep 1
done
for i in *.img
do
echo fastboot flash `basename $i .img` $i
fastboot flash `basename $i .img` $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment