diff options
-rw-r--r-- | chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java b/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java index d4513d1..7c4b62a 100644 --- a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java +++ b/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java @@ -481,7 +481,17 @@ public class AdbChimpDevice implements IChimpDevice { @Override public Map<String, Object> instrument(String packageName, Map<String, Object> args) { - List<String> shellCmd = Lists.newArrayList("am", "instrument", "-w", "-r", packageName); + List<String> shellCmd = Lists.newArrayList("am", "instrument", "-w", "-r"); + for (Entry<String, Object> entry: args.entrySet()) { + final String key = entry.getKey(); + final Object value = entry.getValue(); + if (key != null && value != null) { + shellCmd.add("-e"); + shellCmd.add(key); + shellCmd.add(value.toString()); + } + } + shellCmd.add(packageName); String result = shell(shellCmd.toArray(ZERO_LENGTH_STRING_ARRAY)); return convertInstrumentResult(result); } |