osx - Return code from Mac app -


I am trying to create a Mac app, which in some cases should return an error code. This is the Intel Bundle (this is a carbon C ++ project, but it is probably irrelevant.)

The standard way to do this in C ++ is to bring the value of the main function back, and this I do, so I think the part is correct (I have also tried to call the exit (42) clearly) The question is: I How do I get this value?

When I launch the app, the terminal with the open myapp , the return value is always 0 , even if I always return a different number (

Is this a return value from the open command and has the value of my app's return somewhere swallowed?

I also always get a 0 return code to launch it from another program using execve (which is the app like this Is specified for use).

Is it possible to get a return code from an app?

SidNote : I should put the program in bundle.

$ / Applications / address \ Book.app/Contents/MacOS/Address \ Book


Comments