How to use Process.Start() with arguments on OSX in an EditorWindow?

Process.Start works great on windows, and very simply as well. But it seems a bit funkier on OSX.

I got it working to just launch an application normally. But I cannot figure out how to get it to launch an application with arguments on OSX. More specifically I am trying to launch a command line application with arguments. How do I do that??

I’ve already tried this:
Process p = System.Diagnostics.Process.Start(new ProcessStartInfo(info.FullName, " -fOGLPVRTC4 -q5 -pvrtciterations8 -i" + filePaths + " -o" + filePaths*) { UseShellExecute = false });*
it throws a win32 exception
I found the tip to add ‘{ UseShellExecute = false }’ as I did there on some other mono mac forum. So I put it in there, if you leave that line out however it does nothing.

This is an old question but comes up prominently in Google. I want to offer an answer! I was trying to execute a command which aliased to another binary somewhere in my Mac. What I ended up doing was explicitly writing in the path to the binary. i.e. instead of:

Process p = new Process();

We have:

Process p = new Process();

I hope this helps some people as this was driving me nuts.

Did you try inserting "–args " at the beginning of your arguments string? This solved the issue for me.

This may not be helpful, but you could try this method to add arguments and set properties:

Process p = new Process();
p.StartInfo.Arguments = arguments;			

I had problems getting Process to work at all until I used this method.

Note that not all of that is required. This works too:

Process p = new Process();

And at the top of the cs file, add this:

using System.Diagnostics;

As discovered in this Unity forum thread about System.Diagnostics.Process.

Guys, I have been able to launch .app using Process.Start with UseShellExecute=TRUE, and not only from Applications folder. Specifficaly in inside my app:

I don’t know how it was before, but in Unity 5 it works great!