summaryrefslogtreecommitdiffstats
path: root/build/android/adb_gdb
diff options
context:
space:
mode:
authoragrieve <agrieve@chromium.org>2016-03-18 11:56:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-18 18:57:09 +0000
commitcd4e139b12f45f81a77d6293f1bb9339464f80f4 (patch)
tree4d2ed1c308771b1b3e65798b3eb86efa713a05a6 /build/android/adb_gdb
parent7f8bb7957073020d9fa8bd36ffac971d2c2f52ec (diff)
downloadchromium_src-cd4e139b12f45f81a77d6293f1bb9339464f80f4.zip
chromium_src-cd4e139b12f45f81a77d6293f1bb9339464f80f4.tar.gz
chromium_src-cd4e139b12f45f81a77d6293f1bb9339464f80f4.tar.bz2
adb_gdb: Add --device flag
and fix it not erroring out when multiple devices are attached BUG=none Review URL: https://codereview.chromium.org/1818433002 Cr-Commit-Position: refs/heads/master@{#382036}
Diffstat (limited to 'build/android/adb_gdb')
-rwxr-xr-xbuild/android/adb_gdb8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/android/adb_gdb b/build/android/adb_gdb
index 16139c7..f0e5ccd 100755
--- a/build/android/adb_gdb
+++ b/build/android/adb_gdb
@@ -115,6 +115,9 @@ for opt; do
--adb=*)
ADB=$optarg
;;
+ --device=*)
+ export ANDROID_SERIAL=$optarg
+ ;;
--activity=*)
ACTIVITY=$optarg
;;
@@ -274,7 +277,7 @@ the path to the host target-specific cross-toolchain.
You will also need the 'adb' tool in your path. Otherwise, use the --adb
option. The script will complain if there is more than one device connected
-and ANDROID_SERIAL is not defined.
+and a device is not specified with either --device or ANDROID_SERIAL).
The first time you use it on a device, the script will pull many system
libraries required by the process into a temporary directory. This
@@ -321,6 +324,7 @@ Valid options:
--gdb=<file> Specify host gdb client binary.
--target-arch=<name> Specify NDK target arch.
--adb=<file> Specify host ADB binary.
+ --device=<file> ADB device serial to use (-s flag).
--port=<port> Specify the tcp port to use.
--su-prefix=<prefix> Prepend <prefix> to 'adb shell' commands that are
@@ -390,7 +394,7 @@ fi
# If there are more than one device connected, and ANDROID_SERIAL is not
# defined, print an error message.
NUM_DEVICES_PLUS2=$($ADB devices 2>/dev/null | wc -l)
-if [ "$NUM_DEVICES_PLUS2" -lt 3 -a -z "$ANDROID_SERIAL" ]; then
+if [ "$NUM_DEVICES_PLUS2" -gt 3 -a -z "$ANDROID_SERIAL" ]; then
echo "ERROR: There is more than one Android device connected to ADB."
echo "Please define ANDROID_SERIAL to specify which one to use."
exit 1