2016-01-14 06:53:55 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
2013-04-29 12:09:31 +00:00
|
|
|
#
|
2016-01-14 06:53:55 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
2013-04-29 12:09:31 +00:00
|
|
|
|
|
|
|
UTIL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
if [ "$(which adb)" != "" ]; then
|
|
|
|
ADB="$(which adb)"
|
2014-10-30 12:57:31 +00:00
|
|
|
elif [ -d "$ANDROID_SDK_ROOT" ]; then
|
|
|
|
ADB="${ANDROID_SDK_ROOT}/platform-tools/adb"
|
2013-04-29 12:09:31 +00:00
|
|
|
else
|
2014-10-30 12:57:31 +00:00
|
|
|
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
|
2016-03-17 17:45:47 +00:00
|
|
|
ADB_REQUIRED="1.0.32 or 1.0.35"
|
2014-10-30 12:57:31 +00:00
|
|
|
elif [ $(uname) == "Darwin" ]; then
|
2015-02-20 02:39:40 +00:00
|
|
|
ADB_REQUIRED="1.0.31 or 1.0.32"
|
2013-04-29 12:09:31 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-14 06:53:55 +00:00
|
|
|
# get the version string as an array, use just the version numbers
|
2014-10-30 12:57:31 +00:00
|
|
|
ADB_VERSION="$($ADB version)"
|
2016-01-14 06:53:55 +00:00
|
|
|
ADB_VERSION=($ADB_VERSION)
|
|
|
|
ADB_VERSION=${ADB_VERSION[4]}
|
2014-10-30 12:57:31 +00:00
|
|
|
|
2015-02-20 02:39:40 +00:00
|
|
|
if [[ "$ADB_REQUIRED" != *"$ADB_VERSION"* ]]; then
|
2014-10-30 12:57:31 +00:00
|
|
|
echo "WARNING: Your ADB version is out of date!"
|
|
|
|
echo " Expected ADB Version: ${ADB_REQUIRED}"
|
|
|
|
echo " Actual ADB Version: ${ADB_VERSION}"
|
|
|
|
fi
|