Android tests: start adb server before emulator start, print emulator log to console
This commit is contained in:
@@ -102,12 +102,32 @@ public class Emulator {
|
|||||||
OutputUtils.checkResult(RunUtils.execute(getCreateCommand(), "no"));
|
OutputUtils.checkResult(RunUtils.execute(getCreateCommand(), "no"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startServer() {
|
||||||
public void startEmulator() {
|
GeneralCommandLine commandLine = new GeneralCommandLine();
|
||||||
System.out.println("Starting emulator...");
|
String adbCmdName = SystemInfo.isWindows ? "adb.exe" : "adb";
|
||||||
OutputUtils.checkResult(RunUtils.executeOnSeparateThread(getStartCommand(), false));
|
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + adbCmdName);
|
||||||
|
commandLine.addParameter("start-server");
|
||||||
|
System.out.println("Start adb server...");
|
||||||
|
OutputUtils.checkResult(RunUtils.execute(commandLine));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startEmulator() {
|
||||||
|
startServer();
|
||||||
|
System.out.println("Starting emulator...");
|
||||||
|
OutputUtils.checkResult(RunUtils.executeOnSeparateThread(getStartCommand(), false));
|
||||||
|
printLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printLog() {
|
||||||
|
GeneralCommandLine commandLine = new GeneralCommandLine();
|
||||||
|
String adbCmdName = SystemInfo.isWindows ? "adb.exe" : "adb";
|
||||||
|
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + adbCmdName);
|
||||||
|
commandLine.addParameter("logcat");
|
||||||
|
commandLine.addParameter("-v");
|
||||||
|
commandLine.addParameter("time");
|
||||||
|
commandLine.addParameter("*:I");
|
||||||
|
OutputUtils.checkResult(RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(commandLine, null, false, "LOGCAT: ", true)));
|
||||||
|
}
|
||||||
|
|
||||||
public void waitEmulatorStart() {
|
public void waitEmulatorStart() {
|
||||||
System.out.println("Waiting for emulator start...");
|
System.out.println("Waiting for emulator start...");
|
||||||
|
|||||||
Reference in New Issue
Block a user