Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidStudio: always run on all connected devices

How can I configure AndroidStudio such that the app is run on all connected devices without further inquiry even when I constantly plug in new devices / remove old ones?

Please note that this requires a slightly different approach than this solution, since with their procedure the device selection dialog appears again if you

  • connect another device

or

  • restart Android Studio
like image 939
PhilLab Avatar asked May 15 '15 07:05

PhilLab


1 Answers

I found a bash script that has been working well for me for quite sometime:

adb devices | while read line
do
    if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
    then
        device=`echo $line | awk '{print $1}'`
        echo "$device $@ ..."
        adb -s $device $@
    fi
done

All credits go the github user 'christopherperry'. For more info check this link:

https://gist.github.com/christopherperry/3208109

Hope this helps.

like image 102
user2511882 Avatar answered Nov 09 '22 19:11

user2511882