|
|
@ -308,8 +308,8 @@ public class TryIt {
|
|
|
|
ArrayList<String> devices = new ArrayList<>();
|
|
|
|
ArrayList<String> devices = new ArrayList<>();
|
|
|
|
BufferedReader reader = null;
|
|
|
|
BufferedReader reader = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
reader = new BufferedReader(new InputStreamReader(listAVDsProcess.getInputStream()
|
|
|
|
reader = new BufferedReader(new InputStreamReader(listAVDsProcess.getInputStream(),
|
|
|
|
, StandardCharsets.UTF_8));
|
|
|
|
StandardCharsets.UTF_8));
|
|
|
|
String readLine;
|
|
|
|
String readLine;
|
|
|
|
while ((readLine = reader.readLine()) != null) {
|
|
|
|
while ((readLine = reader.readLine()) != null) {
|
|
|
|
devices.add(readLine);
|
|
|
|
devices.add(readLine);
|
|
|
@ -403,7 +403,6 @@ public class TryIt {
|
|
|
|
* @throws IOException process start throws if an I/O error occurs.
|
|
|
|
* @throws IOException process start throws if an I/O error occurs.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void runEmulator(String deviceId) throws IOException {
|
|
|
|
private void runEmulator(String deviceId) throws IOException {
|
|
|
|
|
|
|
|
|
|
|
|
// mac os and windows needs hardware_Accelerated_execution_Manager
|
|
|
|
// mac os and windows needs hardware_Accelerated_execution_Manager
|
|
|
|
if (osSuffix.equals(Constants.MAC_OS) || osSuffix.equals(Constants.WINDOWS_OS)) {
|
|
|
|
if (osSuffix.equals(Constants.MAC_OS) || osSuffix.equals(Constants.WINDOWS_OS)) {
|
|
|
|
installHAXM();
|
|
|
|
installHAXM();
|
|
|
@ -552,8 +551,6 @@ public class TryIt {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
reader = new BufferedReader(new InputStreamReader(badgingApkFileProcess.getInputStream(),
|
|
|
|
reader = new BufferedReader(new InputStreamReader(badgingApkFileProcess.getInputStream(),
|
|
|
|
StandardCharsets.UTF_8));
|
|
|
|
StandardCharsets.UTF_8));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ((readLine = reader.readLine()) != null) {
|
|
|
|
while ((readLine = reader.readLine()) != null) {
|
|
|
|
if (readLine.contains("package")) {
|
|
|
|
if (readLine.contains("package")) {
|
|
|
|
pkg = readLine.substring(readLine.indexOf(Constants.NAME) + 6).substring(0,
|
|
|
|
pkg = readLine.substring(readLine.indexOf(Constants.NAME) + 6).substring(0,
|
|
|
@ -613,7 +610,6 @@ public class TryIt {
|
|
|
|
ProcessBuilder installAgentProcessBuilder = new ProcessBuilder(adbLocation, "install",
|
|
|
|
ProcessBuilder installAgentProcessBuilder = new ProcessBuilder(adbLocation, "install",
|
|
|
|
androidAgentLocation);
|
|
|
|
androidAgentLocation);
|
|
|
|
Process installAgentProcess = installAgentProcessBuilder.start();
|
|
|
|
Process installAgentProcess = installAgentProcessBuilder.start();
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
installAgentProcess.waitFor();
|
|
|
|
installAgentProcess.waitFor();
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
} catch (InterruptedException e) {
|
|
|
@ -715,14 +711,14 @@ public class TryIt {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
process = processBuilder.start();
|
|
|
|
process = processBuilder.start();
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
handleException("HAXM installation failed", e);
|
|
|
|
System.out.println("HAXM installation failed, install HAXM and try again");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (process != null) {
|
|
|
|
if (process != null) {
|
|
|
|
process.waitFor();
|
|
|
|
process.waitFor();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
handleException("HAXM installation failed", e);
|
|
|
|
System.out.println("HAXM installation failed, install HAXM and try again");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
System.out.println("Please restart your machine and run again.");
|
|
|
|
System.out.println("Please restart your machine and run again.");
|
|
|
|
System.exit(0);
|
|
|
|
System.exit(0);
|
|
|
|