change verbose mode default to true and change param accordingly
vebose mode maps to uncompressed hierarchy on device. since we
are using uncompressed hierarchy by default for device test,
we should use verbose mode by default here.
otherwise when user uses viewer tool, it will show compressed
hierarchy by default, which causes test cases to be written
against wrong assumptions
since we are changing the heuristics here, we are also changing
'--verbose' to '--compressed' accordingly
Change-Id: I6fd55fd57a65d6eb0755ee34cbc1c34731788afb
diff --git a/uiautomator/cmds/uiautomator/src/com/android/commands/uiautomator/DumpCommand.java b/uiautomator/cmds/uiautomator/src/com/android/commands/uiautomator/DumpCommand.java
index 3a4e783..c35f7fc 100644
--- a/uiautomator/cmds/uiautomator/src/com/android/commands/uiautomator/DumpCommand.java
+++ b/uiautomator/cmds/uiautomator/src/com/android/commands/uiautomator/DumpCommand.java
@@ -52,7 +52,7 @@
@Override
public String detailedOptions() {
return " dump [--verbose][file]\n"
- + " [--verbose]: dumps all layout information.\n"
+ + " [--compressed]: dumps compressed layout information.\n"
+ " [file]: the location where the dumped XML should be stored, default is\n "
+ DEFAULT_DUMP_FILE.getAbsolutePath() + "\n";
}
@@ -60,11 +60,11 @@
@Override
public void run(String[] args) {
File dumpFile = DEFAULT_DUMP_FILE;
- boolean verboseMode = false;
+ boolean verboseMode = true;
for (String arg : args) {
- if (arg.equals("--verbose"))
- verboseMode = true;
+ if (arg.equals("--compressed"))
+ verboseMode = false;
else if (!arg.startsWith("-")) {
dumpFile = new File(arg);
}
@@ -73,9 +73,9 @@
UiAutomationShellWrapper automationWrapper = new UiAutomationShellWrapper();
automationWrapper.connect();
if (verboseMode) {
+ // default
automationWrapper.setCompressedLayoutHierarchy(false);
} else {
- // default
automationWrapper.setCompressedLayoutHierarchy(true);
}