Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to pass cmd line arguments to my carbon app?




On Sep 13, 2005, at 6:00 AM, Jay Vaughan wrote:

Hi all,

I have a Carbon app which i want to be able to pass (optional) command line arguments to, the old-school argc/argv way.. like this:

./My.app -somearg -somearg2

It seems that I can't really do this, however .. is it true that I can only pass 'valid' command line arguments into an app bundle by using the Info.plist somehow?

From reading this old thread, I can't really work out how to do this .. is there some magic to doing this that I should obviously know by now, having done my Carbon app? Note that I can set arguments in my XCode project settings for the app, and they get passed in .. but how do I add args to an .app bundle at "Run time", not just "development time"?

You can pass command-line arguments if you launch your app from Terminal and specify the full path to the executable:


./My.app/Contents/MacOS/My -somearg -somearg2

-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: How to pass cmd line arguments to my carbon app? (From: Jay Vaughan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.