Building xcode project from command line : A tutorial
November 10, 2009
Recently, I had to integrate a xcode project into a build script such that the code compiles from command line and then installs into the required location. xcode doesn’t use Makefile to build the project. It has its own build system. However, it does have a way to build the project very easily from the command line.
Use the command xcodebuild to build a xcode project from command line. From the command line go to the directory where xcode project file resides and then execute this command. Various build options can be specified with this command. For example if you are building a framework and want to install it then the following command will work
% sudo xcodebuild install configuration release DSTROOT=/root/installation/path INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES
The option INSTALL_PATH is the path from DSTROOT(Distribution Root). In our example above, after building the framework will be installed at /root/installation/path/Library/Frameworks
Also, if there are multiple targets then xcodebuild command will build the first target if no target is specified. For a complete list of options that can be used with xcodebuild use man xcodebuild
Entry Filed under: Geeky stuff. Tags: xcode.
Trackback this post | Subscribe to the comments via RSS Feed