Android tests: do not call adb emu kill (throws exception if there are more than 1 emulator)
This commit is contained in:
@@ -19,6 +19,7 @@ package org.jetbrains.jet.compiler.emulator;
|
|||||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||||
import com.intellij.openapi.util.SystemInfo;
|
import com.intellij.openapi.util.SystemInfo;
|
||||||
import com.intellij.openapi.util.text.StringUtil;
|
import com.intellij.openapi.util.text.StringUtil;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.compiler.OutputUtils;
|
import org.jetbrains.jet.compiler.OutputUtils;
|
||||||
import org.jetbrains.jet.compiler.PathManager;
|
import org.jetbrains.jet.compiler.PathManager;
|
||||||
import org.jetbrains.jet.compiler.ThreadUtils;
|
import org.jetbrains.jet.compiler.ThreadUtils;
|
||||||
@@ -83,20 +84,17 @@ public class Emulator {
|
|||||||
return commandLine;
|
return commandLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private GeneralCommandLine getStopCommand() {
|
private GeneralCommandLine getStopCommand() {
|
||||||
GeneralCommandLine commandLine = new GeneralCommandLine();
|
|
||||||
if (SystemInfo.isWindows) {
|
if (SystemInfo.isWindows) {
|
||||||
|
GeneralCommandLine commandLine = new GeneralCommandLine();
|
||||||
commandLine.setExePath("taskkill");
|
commandLine.setExePath("taskkill");
|
||||||
commandLine.addParameter("/F");
|
commandLine.addParameter("/F");
|
||||||
commandLine.addParameter("/IM");
|
commandLine.addParameter("/IM");
|
||||||
commandLine.addParameter("emulator-arm.exe");
|
commandLine.addParameter("emulator-arm.exe");
|
||||||
|
return commandLine;
|
||||||
}
|
}
|
||||||
else {
|
return null;
|
||||||
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/adb");
|
|
||||||
commandLine.addParameter("emu");
|
|
||||||
commandLine.addParameter("kill");
|
|
||||||
}
|
|
||||||
return commandLine;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createEmulator() {
|
public void createEmulator() {
|
||||||
@@ -118,7 +116,9 @@ public class Emulator {
|
|||||||
|
|
||||||
public void stopEmulator() {
|
public void stopEmulator() {
|
||||||
System.out.println("Stopping emulator...");
|
System.out.println("Stopping emulator...");
|
||||||
OutputUtils.checkResult(RunUtils.execute(getStopCommand()));
|
if (SystemInfo.isWindows) {
|
||||||
|
OutputUtils.checkResult(RunUtils.execute(getStopCommand()));
|
||||||
|
}
|
||||||
finishProcess("emulator-arm");
|
finishProcess("emulator-arm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user