Building xcode project from command line : A tutorial

November 10, 2009 at 10:37 pm Leave a comment

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


Advertisements

Entry filed under: Geeky stuff. Tags: .

Twitter – Something is technically wrong 5 characteristics of a successful freelancer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


TinyTweets

Feeds


%d bloggers like this: