Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: platform_tools/android/bin/utils/setup_adb.sh

Issue 926003002: Allow either the old or new version of ADB on mac. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix logic Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698