MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent()));
int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux");
int isWindows = System.getProperty("os.name").toLowerCase().indexOf("windows");
+ int isMac = System.getProperty("os.name").toLowerCase().indexOf("mac");
try {
String line;
List<String> cmd = new ArrayList<String>();
cmd.add("/FO");
cmd.add("CSV");
}
+ else if (isMac > -1){
+ cmd.add("/bin/ps");
+ cmd.add("-ef");
+ }
+
ProcessBuilder pb = new ProcessBuilder(cmd);
Process p = pb.start();
return true;
}
}
- }
+ }
+ else if(isMac > -1) {
+ while ((line = stdOut.readLine()) != null) {
+ String imagePath = FileIO.getInstance().getVirtualTargetImagePath(property.getName());
+ if(line.contains(imagePath)) {
+ //logger.log(Level.INFO, line + " contains " + imagePath);
+ logger.log(Level.INFO, "emulator instance with the same name is running now (" + imagePath + ")");
+ stdOut.close();
+ return true;
+ }
+ }
+ }
stdOut.close();
logger.log(Level.INFO, "not exist anywhere\n");
return false;
return dialog.isDisposed();
}
}
-*/
\ No newline at end of file
+*/