Created
February 25, 2015 12:04
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
Slight modification of:
http://stackoverflow.com/questions/8671819/how-can-i-use-adb-to-uninstall-an-apk-from-multiple-connected-devices