I just upgraded to Xcode 4 and can't find much documentation on it yet, since it just went gold master. I need to specify a command line argument for testing my application.
The Xcode 3.2 advice doesn't help since everything got moved around.
go to the 'Info' tab and in a menu 'Executable' choose 'Other...' in file window go to search input field and type 'terminal' and click on its icon when you find it. Now you should see 'Terminal. app' in 'Executable' field.
In the command line, the arguments passed from the console can be received in the java program and they can be used as input. The users can pass the arguments during the execution bypassing the command-line arguments inside the main() method. We need to pass the arguments as space-separated values.
Command line arguments and environment variables can be set up in the Run section of the scheme editor.
Product -> Edit Scheme... -> Run -> Arguments (Copy-Paste from the link given by Jano)
The shortcut cmd + < works too. (Default shortcut)
On Xcode 7 (updated), XCode 10.1
Shortcut : Shift + cmd + <
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With