Passing command line arguments to a carbon app
Shawn Erickson
shawnce at gmail.com
Mon Apr 16 11:10:58 PDT 2007
On 4/17/07, Lothar Scholz <llothar at web.de> wrote:
> 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).
Humm... it works fine for Cocoa application maybe a Carbon specific issue?
> 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).
If you are using Xcode to run your application you can modify the way
it executes your application. Look for the "Executables" group and
then double click on your application (or command-I).
-Shawn
More information about the MacOSX-dev
mailing list