Giving Command line arguments in Xcode in C program

Viewed 82456

I am solving my C assignment in Xcode and in that program i have to give command line arguments when running the program and for this i have to user terminal like this:

./a.out myfirstCommand mySecondCommand

I was wondering if it possible to give these kind of commands within xcode instead of going to terminal. Thanks

6 Answers

As of Xcode 4.x I've had to go to the Product menu, select "Edit Scheme", then select the arguments tab and add the arguments there.

In Xcode 12.3 You can do the following

Menu Item Product -> Scheme -> Edit Scheme -> Arguments Tab -> Arguments Passed on Launch

enter image description here

enter image description here

For XCode v12.5.1, you can pass additional/launch run argument by following action-

  1. Goto edit scheme by "Product>Scheme>Edit Scheme" or by using keyboard shortcut key "CMD+Shift+<"
  2. Then switch to Arguments tab on open dialog box
  3. Here you can pass required launch arguments
Related