tags:

views:

227

answers:

2

Hi,

In my XCode project, I have multiple 'Executables'.
Is it possible to run some of them via Comomand line in a terminal? Instead of running it via 'Run->Debug'?

Thank you.

+1  A: 

Sure.

If you are using the default settings, you'll find the binary in the build subdirectory of your project.

If you have a shared build products location set via preferences, you'll find the binaries below there.

Once you have located the binary, open up a Terminal window and run it just like any other command.

For Cocoa applications, you'll need to specific the path into the app wrapper. Something like:

MyApp.app/Contents/MacOS/MyApp

For example, my preferences are set to build everything into /tmp/bbum-products. Thus, if I build a simple command line tool in Debug mode, I can go to the terminal and type the following to run the built executable (from the project 'somerandomtoolibuilt', obviously):

/tmp/bbum-products/Debug/somerandomtoolibuilt

And, sure enough, it spews:

2009-09-11 00:44:11.164 somerandomtoolibuilt[7585:903] Hello, World!
bbum
A: 

You can also use the command "open MyApp.app"

Ludvig A Norin