mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Adding kill-server method
This commit is contained in:
parent
d786b7d839
commit
702287e09b
@ -744,11 +744,32 @@ public class TryIt {
|
||||
default:
|
||||
qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386";
|
||||
}
|
||||
killServer();
|
||||
|
||||
setExecutePermission(qemuSystemFileLocation);
|
||||
ExecutorService service = Executors.newSingleThreadExecutor();
|
||||
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.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user