Reputation: 25099
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
Upvotes: 84
Views: 96645
Reputation: 19
For XCode v12.5.1, you can pass additional/launch run argument by following action-
Upvotes: 1
Reputation: 2929
In Xcode 8.x just select the project from the title bar and select Edit Scheme (not schema), then select the Run debug and select the Arguments Tab from the popup window.
Upvotes: 24
Reputation: 7804
In Xcode 12.3 You can do the following
Menu Item Product -> Scheme -> Edit Scheme -> Arguments Tab -> Arguments Passed on Launch
Upvotes: 14
Reputation: 224944
Pre Xcode 4.x
Right click the executable in your Xcode project and pick "Get Info". Then pick the "arguments" tab and you can set arguments to pass when you run or debug your program from inside Xcode.
Xcode 4.x or later
Go to the Product menu, select "Edit Scheme", then select the arguments tab and add the arguments there.
Upvotes: 38
Reputation: 8210
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.
Upvotes: 160