I’m a command line guy. I like looking at the black background of terminal and white text, highlighted by ansi color. I’m old school, and I enjoy the speed and power found there as well. So imagine how excited I was to find out that not only could I be writing iOS mobile applications (iPhone, iPad) using the web language I’m already good with… I could do the whole process from the command line!
Here’s a quick video showing the process:
The video cuts off as I’m about to plug the sites to get this process rolling, but I’ll detail that below. These instructions are for Mac uses with Mountain Lion. I had to upgrade from Snow Leopard to do this!
Take a look at that article, and make sure you have the software in place. You may need to do things like download Xcode and the Xcode Command Line Tools. You will also want the PhoneGap iOS simulator launcher for the command line. If you already have HomeBrew installed, just run ‘brew install ios-sim’. If you need HomeBrew, run this from the Terminal (Your Mac already has Ruby by default):
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
When you get to the part in the official guide that says “Create New Project” switch to this document: Command Line Usage
This is pretty much where my video starts off. In the video I’ve moved the Cordova iOS project generator files to a convenient location for later use. I also went into Sublime Text 2 and created a snippet for generating the key command line instructions you need to generate a new project, build the project, and then run it in the simulator (as well as a few others I find helpful).
I hope this kickstarts your adventures into programming iOS with web tech. It took me a day to get everything setup (I had to upgrade my OS as well), and figure out the docs. Hopefully this post helps you bypass some of the research I had to do to get this sweet setup going.