views:

494

answers:

1

I'd like to be able to pass command line arguments to programs that are run/debugged under Xcode. I want to do this so that I can command-line enable debug modes using Cocoa's NSUserDefaults and NSArgumentDomain.

How to do that?

Thanks!

+6  A: 

In the left-hand sidebar, expand the Executables section, then right-click the executable you want to have arguments and hit Get Info. Go to the Arguments tab - it has two sections you can use:

  • Arguments, for command-line arguments you want sent to your program
  • Environment, for variables you want set in the environment before your program launches
Tim