MrDuk
MrDuk

Reputation: 18322

How can I launch a C application from terminal, and pass in paramaters to int main(int argc, char *argv[])?

I'm new to development on Mac - I'm coding in xcode and I can't figure out how to launch my application with paramaters. I can navigate to the application directory and do something along the lines of:

open application

But I can't do:

open application param1 param2

What am I missing?

Upvotes: 1

Views: 130

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 993981

Use the --args flag, available in OS X 10.6.2 or later:

open application --args param1 param2

See How can I run an application with command line arguments in Mac OS for more information.

Upvotes: 7

Related Questions