Adding kill-server method

merge-requests/1/head
Nirothipan 8 years ago
parent d786b7d839
commit 702287e09b

@ -744,11 +744,32 @@ public class TryIt {
default: default:
qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386"; qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386";
} }
killServer();
setExecutePermission(qemuSystemFileLocation); setExecutePermission(qemuSystemFileLocation);
ExecutorService service = Executors.newSingleThreadExecutor(); ExecutorService service = Executors.newSingleThreadExecutor();
service.execute(new TryItEmulator(deviceId, emulatorLocation)); service.execute(new TryItEmulator(deviceId, emulatorLocation));
} }
/**
* This method ensures device properly starts.
*/
private void killServer() {
ProcessBuilder processBuilderKillServer = new ProcessBuilder(adbLocation, "kill-server");
Process processKillServer = null;
try {
processKillServer = processBuilderKillServer.start();
} catch (IOException ignored) {
// process works if restarted
}
try {
processKillServer.waitFor();
} catch (InterruptedException ignored) {
// can be continued
}
}
/** /**
* This method halts the system the cache.img file is created for the particular AVD started. * This method halts the system the cache.img file is created for the particular AVD started.
* *

Loading…
Cancel
Save