OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 | 3 |
4 UTIL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 4 UTIL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
5 | 5 |
6 if [ "$(which adb)" != "" ]; then | 6 if [ "$(which adb)" != "" ]; then |
7 ADB="$(which adb)" | 7 ADB="$(which adb)" |
8 elif [ -d "$ANDROID_SDK_ROOT" ]; then | 8 elif [ -d "$ANDROID_SDK_ROOT" ]; then |
9 ADB="${ANDROID_SDK_ROOT}/platform-tools/adb" | 9 ADB="${ANDROID_SDK_ROOT}/platform-tools/adb" |
10 else | 10 else |
11 echo $ANDROID_SDK_ROOT | 11 echo $ANDROID_SDK_ROOT |
12 echo "No ANDROID_SDK_ROOT set (check that android_setup.sh was properly source
d)" | 12 echo "No ANDROID_SDK_ROOT set (check that android_setup.sh was properly source
d)" |
13 exit 1 | 13 exit 1 |
14 fi | 14 fi |
15 | 15 |
16 if [ ! -x $ADB ]; then | 16 if [ ! -x $ADB ]; then |
17 echo "The adb binary is not executable" | 17 echo "The adb binary is not executable" |
18 exit 1 | 18 exit 1 |
19 fi | 19 fi |
20 | 20 |
21 if [ $(uname) == "Linux" ]; then | 21 if [ $(uname) == "Linux" ]; then |
22 ADB_REQUIRED="1.0.32" | 22 ADB_REQUIRED="1.0.32" |
23 elif [ $(uname) == "Darwin" ]; then | 23 elif [ $(uname) == "Darwin" ]; then |
24 ADB_REQUIRED="1.0.31" | 24 ADB_REQUIRED="1.0.31 or 1.0.32" |
25 fi | 25 fi |
26 | 26 |
27 # get the version and then truncate it to be just the version numbers | 27 # get the version and then truncate it to be just the version numbers |
28 ADB_VERSION="$($ADB version)" | 28 ADB_VERSION="$($ADB version)" |
29 ADB_VERSION="${ADB_VERSION##* }" | 29 ADB_VERSION="${ADB_VERSION##* }" |
30 | 30 |
31 if [ $ADB_VERSION != $ADB_REQUIRED ]; then | 31 if [[ "$ADB_REQUIRED" != *"$ADB_VERSION"* ]]; then |
32 echo "WARNING: Your ADB version is out of date!" | 32 echo "WARNING: Your ADB version is out of date!" |
33 echo " Expected ADB Version: ${ADB_REQUIRED}" | 33 echo " Expected ADB Version: ${ADB_REQUIRED}" |
34 echo " Actual ADB Version: ${ADB_VERSION}" | 34 echo " Actual ADB Version: ${ADB_VERSION}" |
35 fi | 35 fi |
OLD | NEW |