Passing command line arguments to a carbon app

Lothar Scholz llothar at web.de
Tue Apr 17 00:23:15 PDT 2007


Hello Shawn,

SE> If you want to send in command-line options as part of development
SE> work or testing then you can do it as follows in a shell
SE> (Terminal.app)...

Yes that's the purpose.

>> ./MyApplication.app/Contents/MacOS/MyApplication <command-line args here>

SE> It is important to understand that doing things this way results in
SE> your application running in a way different then the user
SE> double-clicking on it. For example working directory, environment
SE> vars, stdout/in, etc. will be different.

AFAIK then the GUI does not work anymore (i tried some time ago on
10.3).

So it seems that i write a little startscript that wraps the test
arguments into environment variables. Is it possible or are the
environment variables also not taken from the starting terminal
process (i would now guess so).

-- 
Best regards,
 Lothar                            mailto:llothar at web.de



More information about the MacOSX-dev mailing list