diff options
author | Kenny Root <kroot@google.com> | 2012-01-04 09:51:16 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-04 09:51:16 -0800 |
commit | 126c35356a2864970dc1d68b4615b4a378ed27e0 (patch) | |
tree | c13d1e36d30cb8f67dfce7601eef936c7cc91563 | |
parent | f5c91e24e04b23cb2b973975757a5b7c46cd9cd4 (diff) | |
parent | 5e79286e6441bb50f281fe4bf675fc796a338cd2 (diff) | |
download | sdk-126c35356a2864970dc1d68b4615b4a378ed27e0.zip sdk-126c35356a2864970dc1d68b4615b4a378ed27e0.tar.gz sdk-126c35356a2864970dc1d68b4615b4a378ed27e0.tar.bz2 |
Merge "Add support for ANDROID_SERIAL in screenshot"
-rw-r--r-- | screenshot/src/com/android/screenshot/Screenshot.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/screenshot/src/com/android/screenshot/Screenshot.java b/screenshot/src/com/android/screenshot/Screenshot.java index 930ea8e..d93e6ff 100644 --- a/screenshot/src/com/android/screenshot/Screenshot.java +++ b/screenshot/src/com/android/screenshot/Screenshot.java @@ -85,6 +85,17 @@ public class Screenshot { } } while (index < args.length); + /* + * If no command-line switches and no serial number was passed on the + * command-line, try to read a serial number from the shell environment. + */ + if (!device && !emulator && serial == null) { + String envSerial = System.getenv("ANDROID_SERIAL"); + if (envSerial != null) { + serial = envSerial; + } + } + if (filepath == null) { printUsageAndQuit(); } |