Merge pull request #717 from Nirothipan/master

Changes in Android Try It Emulator due to SDK folder structure change
revert-dabc3590
sinthuja 8 years ago committed by GitHub
commit 0d200798f4

@ -766,6 +766,22 @@ public class TryIt {
default: default:
qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386"; qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386";
} }
setExecutePermission(qemuSystemFileLocation);
qemuSystemFileLocation = androidSdkHome + File.separator + "emulator" + File.separator
+ "qemu" + File.separator;
switch (osSuffix) {
case Constants.MAC_OS:
qemuSystemFileLocation += Constants.MAC_DARWIN + "-x86_64" + File.separator + "qemu-system-i386";
break;
case Constants.WINDOWS_OS:
qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386.exe";
break;
default:
qemuSystemFileLocation += osSuffix + "-x86_64" + File.separator + "qemu-system-i386";
}
killServer(); killServer();
setExecutePermission(qemuSystemFileLocation); setExecutePermission(qemuSystemFileLocation);
ExecutorService service = Executors.newSingleThreadExecutor(); ExecutorService service = Executors.newSingleThreadExecutor();
@ -814,6 +830,7 @@ public class TryIt {
* @param fileName name of the file to set execution permission. * @param fileName name of the file to set execution permission.
*/ */
private void setExecutePermission(String fileName) { private void setExecutePermission(String fileName) {
if (new File((fileName)).exists()) {
if (!new File(fileName).canExecute()) { if (!new File(fileName).canExecute()) {
if (!new File(fileName).setExecutable(true)) { if (!new File(fileName).setExecutable(true)) {
System.out.println("Unable to set the execute permission of : " + fileName); System.out.println("Unable to set the execute permission of : " + fileName);
@ -823,6 +840,7 @@ public class TryIt {
} }
} }
} }
}
/** /**
* This method extracts the zip folder. * This method extracts the zip folder.

Loading…
Cancel
Save