• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6if [ $PYADB ] && [ -a "$PYADB" ]; then
7  echo "Python ADB detected, going to use that"
8  ADB="python ${PYADB}"
9  return
10fi
11
12if [ "$(which adb)" != "" ]; then
13    ADB="$(which adb)"
14elif [ -d "$ANDROID_SDK_ROOT" ]; then
15    ADB="${ANDROID_SDK_ROOT}/platform-tools/adb"
16else
17  echo $ANDROID_SDK_ROOT
18  echo "No ANDROID_SDK_ROOT set (check that android_setup.sh was properly sourced)"
19  exit 1
20fi
21
22if [ ! -x $ADB ]; then
23  echo "The adb binary is not executable"
24  exit 1
25fi
26