1 # Copyright 2015 Google Inc. 2 # 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 if [ $PYADB ] && [ -a "$PYADB" ]; then 7 echo "Python ADB detected, going to use that" 8 ADB="python ${PYADB}" 9 return 10 fi 11 12 if [ "$(which adb)" != "" ]; then 13 ADB="$(which adb)" 14 elif [ -d "$ANDROID_SDK_ROOT" ]; then 15 ADB="${ANDROID_SDK_ROOT}/platform-tools/adb" 16 else 17 echo $ANDROID_SDK_ROOT 18 echo "No ANDROID_SDK_ROOT set (check that android_setup.sh was properly sourced)" 19 exit 1 20 fi 21 22 if [ ! -x $ADB ]; then 23 echo "The adb binary is not executable" 24 exit 1 25 fi 26