@@ -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 += "\t stopped" ;
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 += "\t data 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 += "\t starting 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