I’m putting together a bunch of bash scripts that I use while developing Android apps with Android Studio. This first script will iterate through each relevant line that is outputted from the adb devices command. So if multiple devices are connected to adb, then all are listed. I’m using the -e argument with grep to search for the patterns that I want returned. The example below will return manufacture, model and processor information for each device.
All scripts can be downloaded from my GitHub Android-Utility-Bash-Scripts
Note that the environment variable named ANDROID_HOME must be set to the Android SDK path. On Mac OS X this is usually based off the user path from the Library:
Full path would be:
So before running this script open your ~/.bash_profile and add the following line:
Make sure to put in your relevant username in the above path. After you have downloaded the repo you can run the following by executing:
echo "List Device Architectures..."
# get full path to adb just in case script gets confused
for SERIAL in $(adb devices | tail -n +2 | cut -sf 1);
echo "**** Device Serial Number -> $SERIAL Architecture *****";
adb -s $SERIAL shell getprop | grep -e manufacturer -e model -e abi
echo "**** END $SERIAL ****";
echo "***** End List Device Architecture *****"
[…] Android Studio: ADB Bash Utility Scripts […]