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

Unified Diff: build/android/adb_gdb

Issue 1818433002: 🚕 adb_gdb: Add --device flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: build/android/adb_gdb
diff --git a/build/android/adb_gdb b/build/android/adb_gdb
index 16139c7176e44afc440e2cb5e7385e588576b458..f0e5ccda1eb983d1651afe11f181a6464a43b1cc 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
« 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