Skip to content

Commit c92e47c

Browse files
committed
fixes bug where mayn packageDependetActions (clear, force-stop, start activity) would not work when more than 1 device was connected
updates version to 0.9.1
1 parent 57cdc67 commit c92e47c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>at.favre.tools</groupId>
88
<artifactId>uber-adb-tools</artifactId>
9-
<version>0.9.0</version>
9+
<version>0.9.1</version>
1010

1111
<prerequisites>
1212
<maven>3.1.0</maven>

src/main/java/at/favre/tools/uberadb/actions/PackageDependentAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ public static void execute(AdbLocationFinder.LocationResult adbLocation, Arg arg
3434
actionResult.failureCount++;
3535
}
3636
} else if (arguments.mode == Arg.Mode.FORCE_STOP) {
37-
Commons.runAdbCommand(new String[]{"shell", "am", "force-stop", filteredPackage}, cmdProvider, adbLocation);
37+
Commons.runAdbCommand(new String[]{"-s", device.serial, "shell", "am", "force-stop", filteredPackage}, cmdProvider, adbLocation);
3838
packgeActionLog += "\tstopped";
3939
actionResult.successCount++;
4040
} else if (arguments.mode == Arg.Mode.CLEAR) {
41-
Commons.runAdbCommand(new String[]{"shell", "pm", "clear", filteredPackage}, cmdProvider, adbLocation);
41+
Commons.runAdbCommand(new String[]{"-s", device.serial, "shell", "pm", "clear", filteredPackage}, cmdProvider, adbLocation);
4242
packgeActionLog += "\tdata cleared";
4343
actionResult.successCount++;
4444
} else if (arguments.mode == Arg.Mode.INFO) {
4545
packgeActionLog += "\n" + getFullPackageInfo(packageInfo);
4646
actionResult.successCount++;
4747
} else if (arguments.mode == Arg.Mode.START_ACTIVITY) {
4848
packgeActionLog += "\tstarting app";
49-
Commons.runAdbCommand(new String[]{"shell", "monkey", "-p", filteredPackage, "-c", "android.intent.category.LAUNCHER", "1"}, cmdProvider, adbLocation);
49+
Commons.runAdbCommand(new String[]{"-s", device.serial, "shell", "monkey", "-p", filteredPackage, "-c", "android.intent.category.LAUNCHER", "1"}, cmdProvider, adbLocation);
5050
actionResult.successCount++;
5151
}
5252
} else {

0 commit comments

Comments
 (0)