Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 9635378009
Fetching contributors…

Cannot retrieve contributors at this time

63 lines (43 sloc) 2.578 kB

iOS build tools for command line

Author: Paul van der Walt, 2011


If you're like me, you don't like to use XCode, but are forced to. Here is a (partial) solution to the problem: a set of ugly hacks using Rake, xcodebuild (the XCode command-line build tool) and a utility called iphonesim (from which can launch the iOS simulator from the console.


Make a clone of these scripts somewhere and place this directory in your $PATH. This way, if something gets updated, you just do a git pull and you're good to go again. Now go to your iOS project directory (or a directory which has a .xcodeproj file somewhere in it's children), and make a symlink to the Rakefile. For example, do:

$ ln -s $IOS_BUILDTOOLS_CLONE/Rakefile
$ cd some/deep/subdir
$ rake

Now, you'll be able to run rake from within any subdirectory of your project (for example if you're using Vim as an editor), and the Rake system will locate the Rakefile. Next, the Rakefile locates the .xcodeproj/ directory, which it passes to the script. It does some magic (feel free to customize the script for your needs, current defaults are latest iOS SDK, iPad, Debug build), and then, if the build was successful, runs your new target in the iOS simulator. I find this very useful.

If you want Vim to be able to use the rakefile using the normal :make command, you can add the following line to your .vimrc:

autocmd FileType objc set makeprg=rake


Note that if you want to run the Vim command :make, you might need to edit Vim's path setting, for example with :set path+=/checkout/location. In my case, I also needed to add a file to /etc/paths.d with the paths to and iphonesim, before MacVim would manage to make things out the box.


If you use (Mac)Vim like me, you might want to look at the following plugins.

  • cocoa.vim
  • snipmate.vim
  • errormarker.vim

To make documentation browsing much less of a pain (using K in vim), consider applying this workaround:


I didn't really create anything here, I just put a few building blocks together the way I liked them. Credit should go to the following people (see the URLs for where I got all the ingredients for this toolset):

Jump to Line
Something went wrong with that request. Please try again.