Skip to content

Instantly share code, notes, and snippets.

@mazurio
Created February 25, 2015 12:04
Show Gist options
  • Save mazurio/357e003f1532b6bc2bfd to your computer and use it in GitHub Desktop.
Save mazurio/357e003f1532b6bc2bfd to your computer and use it in GitHub Desktop.
Bash Android: Run gradle install flavour and send an intent to every device in order to launch application on all devices.
#!/bin/bash
# Runs gradle task installGoogleDebug and starts MainActivity on each available running device and emulator.
./gradlew installGoogleDebug &&
adb devices | while read line
do
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
then
device=`echo $line | awk '{print $1}'`
echo "Starting Application on device: $device $@ ..."
adb -s $device shell am start -n io.mazur.project/io.mazur.project.ui.MainActivity
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment