Skip to content

Instantly share code, notes, and snippets.

@divegeek
divegeek / adb-setdev.sh
Last active August 29, 2015 14:26 — forked from ncornette/gist:3272344
An interactive Bash function that allow you to select an Android device in a list then Sets ANDROID_SERIAL
# Display a list of all connected Android devices
# Set ANDROID_SERIAL environment from selected item
# Example of use : # adb-setdev && adb install -r myapp.apk
function adb-setdev()
{
devices=($(adb devices|grep "device$"|cut -f1))
devices_count=${#devices[*]}
if [ "$devices_count" -eq "0" ]
then
unset ANDROID_SERIAL