Esempio n. 1
0
 public static List<IOSDevice> listDevices(IProgressMonitor monitor) throws CoreException {
   StringBuilder cmdLine = new StringBuilder();
   cmdLine.append("xcrun");
   cmdLine.append(" simctl list ");
   ExternalProcessUtility processUtility = new ExternalProcessUtility();
   DeviceListParser parser = new DeviceListParser();
   processUtility.execSync(cmdLine.toString(), null, parser, parser, monitor, null, null);
   return parser.getDeviceList();
 }
Esempio n. 2
0
 public IOSSimulator launch() throws CoreException {
   StringBuilder cmdLine = new StringBuilder();
   cmdLine.append("xcrun");
   cmdLine.append(" instruments -w ");
   cmdLine.append(getDeviceId().getDeviceId());
   ExternalProcessUtility processUtility = new ExternalProcessUtility();
   processUtility.execSync(
       cmdLine.toString(), null, null, null, getProgressMonitor(), environment, null);
   return this;
 }
Esempio n. 3
0
 public IOSSimulator installApp(String path) throws CoreException {
   StringBuilder cmdLine = new StringBuilder();
   cmdLine.append("xcrun");
   cmdLine.append(" simctl install ");
   cmdLine.append(getDeviceId().getDeviceId()).append(" ");
   cmdLine.append("\"").append(path).append("\"");
   ExternalProcessUtility processUtility = new ExternalProcessUtility();
   processUtility.execSync(
       cmdLine.toString(), null, null, null, getProgressMonitor(), environment, null);
   return this;
 }
Esempio n. 4
0
  private void doBuildProject(File projectLocation, IProgressMonitor monitor) throws CoreException {
    if (monitor.isCanceled()) {
      return;
    }
    try {
      monitor.beginTask(Messages.MSBuild_BuildProjectTask, 10);
      String msBuild = getMSBuildPath();
      if (msBuild != null) {
        File csprojFile = WPProjectUtils.getCsrojFile(projectLocation);
        // on this stage it cannot be null
        Assert.isNotNull(csprojFile);
        StringBuilder cmdString = new StringBuilder(addQuotes(msBuild));
        cmdString.append(" "); // $NON-NLS-1$
        if (isRelease()) {
          cmdString.append("/p:Configuration=Release "); // $NON-NLS-1$
        }
        cmdString.append(addQuotes(csprojFile.getAbsolutePath()));

        ExternalProcessUtility processUtility = new ExternalProcessUtility();
        if (monitor.isCanceled()) {
          return;
        }
        monitor.worked(1);
        int ret =
            processUtility.execSync(
                cmdString.toString(),
                projectLocation,
                null,
                null,
                monitor,
                null,
                getLaunchConfiguration());
        if (ret != 0) {
          throw new CoreException(
              new Status(IStatus.ERROR, WPCore.PLUGIN_ID, Messages.MSBuild_MSBuildError));
        }
      }
    } finally {
      monitor.done();
    }
  }