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,12 +830,14 @@ 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).canExecute()) { if (new File((fileName)).exists()) {
if (!new File(fileName).setExecutable(true)) { if (!new File(fileName).canExecute()) {
System.out.println("Unable to set the execute permission of : " + fileName); if (!new File(fileName).setExecutable(true)) {
System.out.println("Please set the executable permission for file " System.out.println("Unable to set the execute permission of : " + fileName);
+ new File(fileName).getAbsolutePath() + " to continue"); System.out.println("Please set the executable permission for file "
System.exit(1); // if can't execute, unable to proceed + new File(fileName).getAbsolutePath() + " to continue");
System.exit(1); // if can't execute, unable to proceed
}
} }
} }
} }

Loading…
Cancel
Save