Re: Calling cocoa app from command line
Re: Calling cocoa app from command line
- Subject: Re: Calling cocoa app from command line
- From: "Clark Cox" <email@hidden>
- Date: Thu, 15 Mar 2007 14:52:47 -0700
On 3/14/07, Mark Ritchie <email@hidden> wrote:
On 14-Mar-07, at 3:47 PM, Daryl Thachuk wrote:
> Look at 'open'
or if you know the path to the application then launch it directly:
.../MyApp.app/Contents/MacOS/MyApp
Just an FYI to the OP. These will result in very different running
environments for your program, and would be desirable in different
situations.
'open' will open the application just as double clicking on it would
have. This means that if an instance of your app is already running,
it will simply be reactivated (i.e. open will not start a new instance
of your application)
Running it directly from the command-line (i.e. the second suggestion
above) will run it as a subprocess of your shell. This means that it
will inherit your shell's environment, and will have its stdin/out
attached to the same files as the shell itself, etc. *and* it will not
reactivate an already running instance of your app.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden