public static MonoMacProcess OpenApplication(MonoMacExecutionCommand command, ApplicationStartInfo asi,
                                                     Action <string> stdout, Action <string> stderr)
        {
            var logDir = command.AppPath.ParentDirectory;
            var outLog = logDir.Combine("stdout.log");
            var errLog = logDir.Combine("stderr.log");

            try {
                if (File.Exists(errLog))
                {
                    File.Delete(errLog);
                }
                if (File.Exists(outLog))
                {
                    File.Delete(outLog);
                }
            } catch (IOException) {}

            var outTail = new Tail(outLog, stdout);
            var errTail = new Tail(errLog, stderr);

            outTail.Start();
            errTail.Start();

            if (asi == null)
            {
                asi = new ApplicationStartInfo(command.AppPath);
            }
            asi.NewInstance = true;

            //need async or we won't be able to debug things that happen while the app is launching
            asi.Async = true;

            var monoRuntime = (MonoDevelop.Core.Assemblies.MonoTargetRuntime)command.Runtime;

            //assume MD is running on /L/F/M.f/V/Current
            //if target runtime is different then override for bundle
            if (!monoRuntime.IsRunning)
            {
                asi.Environment ["MONOMAC_DEBUGLAUNCHER_RUNTIME"] = monoRuntime.Prefix;
            }

            asi.Environment ["MONOMAC_DEBUGLAUNCHER_LOGDIR"] = logDir;

            var psn = LaunchServices.OpenApplication(asi);

            return(new MonoMacProcess(psn, outTail, errTail));
        }
		public static MonoMacProcess OpenApplication (MonoMacExecutionCommand command, ApplicationStartInfo asi,
			Action<string> stdout, Action<string> stderr)
		{
			var logDir = command.AppPath.ParentDirectory;
			var outLog = logDir.Combine ("stdout.log");
			var errLog = logDir.Combine ("stderr.log");
			try {
				if (File.Exists (errLog))
				    File.Delete (errLog);
				if (File.Exists (outLog))
					File.Delete (outLog);
			} catch (IOException) {}
			
			var outTail = new Tail (outLog, stdout);
			var errTail = new Tail (errLog, stderr);
			outTail.Start ();
			errTail.Start ();
			
			if (asi == null)
				asi = new ApplicationStartInfo (command.AppPath);
			asi.NewInstance = true;
			
			//need async or we won't be able to debug things that happen while the app is launching
			asi.Async = true;
			
			var monoRuntime = (MonoDevelop.Core.Assemblies.MonoTargetRuntime)command.Runtime;
			
			//assume MD is running on /L/F/M.f/V/Current
			//if target runtime is different then override for bundle
			if (!monoRuntime.IsRunning) {
				asi.Environment ["MONOMAC_DEBUGLAUNCHER_RUNTIME"] = monoRuntime.Prefix;
			}
			
			asi.Environment ["MONOMAC_DEBUGLAUNCHER_LOGDIR"] = logDir;
			
			var psn = LaunchServices.OpenApplication (asi);
			return new MonoMacProcess (psn, outTail, errTail);
		}
		public MonoMacDebuggerStartInfo (MonoMacExecutionCommand cmd)
			: base (new SoftDebuggerListenArgs (cmd.AppPath.FileNameWithoutExtension, IPAddress.Loopback, 0))
		{
			ExecutionCommand = cmd;
		}
Example #4
0
		public MonoMacDebuggerStartInfo (MonoMacExecutionCommand cmd)
			: base (cmd.AppPath.FileNameWithoutExtension, IPAddress.Loopback, 8901)
		{
			ExecutionCommand = cmd;
		}