Android Device ID Utility
A commandline utility to get the device ID of the nth device plugged in. This is useful if you often run adb commands with multiple devices plugged in. Drop this in your ~/.profile:
# Usage: 'device 1' returns the first device plugged in
function device()
{
devIndex=`expr "$1" + 1`
adb devices | head -$devIndex | tail -n 1 | awk '{print $1}'
}
Written by Dennis Cornwell
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#