How to run Xcode binaries from command line

In my Xcode project, I have several "executables".
Is it possible to run some of them through the Comomand line in the terminal? Instead of running it via "Run-> Debug"?

Thank.

+2


source to share


2 answers


Sure.

If you are using the default settings, you will find the binary in a subdirectory of build

your project.

If you have the location of the common build products specified through settings, you will find the binaries there.

Once you find the binary, open up a terminal window and run it just like any other command.

For Cocoa applications, you need to provide the path in the application shell. Something like:



MyApp.app/Contents/MacOS/MyApp

      

For example, my settings are set to create everything in /tmp/bbum-products

. This way, if I build a simple command line tool in debug mode, I can go to terminal and type the following to run the embedded executable (obviously from the "somerandomtoolibuilt" project):

/tmp/bbum-products/Debug/somerandomtoolibuilt 

      

And of course it spews:

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

      

+2


source


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



+1


source







All Articles