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

Unified Diff: platform_tools/android/bin/utils/setup_adb.sh

Issue 692513003: Use the most recent version of ADB from the SDK if necessary. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: keep adb Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/utils/setup_adb.sh
diff --git a/platform_tools/android/bin/utils/setup_adb.sh b/platform_tools/android/bin/utils/setup_adb.sh
index 40fd65f841071a05e3f0adaacba3a840afae370c..e372dd2913021d0081c812b857a002f5e75bfb98 100644
--- a/platform_tools/android/bin/utils/setup_adb.sh
+++ b/platform_tools/android/bin/utils/setup_adb.sh
@@ -5,13 +5,31 @@ UTIL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$(which adb)" != "" ]; then
ADB="$(which adb)"
-elif [ $(uname) == "Linux" ]; then
- ADB=$UTIL_DIR/../linux/adb
-elif [ $(uname) == "Darwin" ]; then
- ADB=$UTIL_DIR/../mac/adb
+elif [ -d "$ANDROID_SDK_ROOT" ]; then
+ ADB="${ANDROID_SDK_ROOT}/platform-tools/adb"
else
- echo "ERROR: Could not find ADB!"
- exit 1;
+ echo $ANDROID_SDK_ROOT
+ echo "No ANDROID_SDK_ROOT set (check that android_setup.sh was properly sourced)"
+ exit 1
+fi
+
+if [ ! -x $ADB ]; then
+ echo "The adb binary is not executable"
+ exit 1
+fi
+
+if [ $(uname) == "Linux" ]; then
+ ADB_REQUIRED="1.0.32"
+elif [ $(uname) == "Darwin" ]; then
+ ADB_REQUIRED="1.0.31"
fi
-#echo "ADB is: $ADB"
+# get the version and then truncate it to be just the version numbers
+ADB_VERSION="$($ADB version)"
+ADB_VERSION="${ADB_VERSION##* }"
+
+if [ $ADB_VERSION != $ADB_REQUIRED ]; then
+ echo "WARNING: Your ADB version is out of date!"
+ echo " Expected ADB Version: ${ADB_REQUIRED}"
+ echo " Actual ADB Version: ${ADB_VERSION}"
+fi
« 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