aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screenshot/src/com/android/screenshot/Screenshot.java11
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();
}