Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you specify command line arguments in Xcode 4?

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.

like image 304
Joshua Olson Avatar asked Feb 17 '11 05:02

Joshua Olson


People also ask

How do I run a command in Xcode?

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.

Which method we used for command line arguments?

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.


2 Answers

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)

like image 131
CedricSoubrie Avatar answered Oct 21 '22 09:10

CedricSoubrie


The shortcut cmd + < works too. (Default shortcut)

On Xcode 7 (updated), XCode 10.1

Shortcut : Shift + cmd + <

like image 25
Merlin Avatar answered Oct 21 '22 08:10

Merlin