Random programming things I'd want to remember

Thursday, March 1, 2012

Compile Objective-C code From Terminal With ARC Using xcodebuild

I was perfectly happy compiling Objective-C from the command line until I hit a snag. As a result, I found out about xcodebuild from Joshua Smith . I am still in the process of researching this tool, but so far I use it this way:

xcodebuild -project yourprojectname.xcodeproj -alltargets


and then I use the
./yourprojectname 

command to start the app (I can customize the name of the executable in the project settings).

One thing to note: the xcodebuild command needs the .xcodeproj file to run, so you need to provide the path to the .xcodeproj file when issuing the command.

No comments: