It has been a little while since I have updated Phonegap/Cordova for my projects, but with iOS7’s release, and the partial breaking of a few of my apps, including the infamous Whipped zApp, I’ve decided it is time for a framework update. For my development environment, I use an OS X 10.7 virtual machine. So first thing I had to do was update it to 10.8.5 to support the latest version of Xcode, which is needed for iOS7. Luckily VMware has made strides in the last few months supporting OS X in a virtual machine, and the update went rather smooth. The only hiccup encountered was that my 10.7 machine was 32-bit. I had to go into VMware’s ESXi and change it to 10.8 64-bit, and everything booted perfectly after the update!
After the OS was updated to OS X 10.8.5, I was able to download the latest free version of xcode from the App Store and go through the process of updating it with the latest simulator and documentation within the app.
It may sound like a little work, but that was the easy part. The “hardest part” was relearning PhoneGap again. With version 3.0, the creators have moved to a nodeJS based framework and deployment. Here are the steps I used to get PhoneGap installed.
- Download nodeJS and install on the development Mac (if you downloaded an MSI file, you downloaded the wrong version).
- Open up Terminal and type:
1
sudo npm install -g phonegap
sudo npm install -g phonegap
- After a lot of crap scrolls on the screen, Phonegap should be ready to use from the console to make your first project.
- Next, change to the directory you want to keep your source code and type the following to create your project folder:
1
phonegap create hello com.example.hello HelloWorld
phonegap create hello com.example.hello HelloWorld
This will create a folder in your directory called “hello” with a basic framework for develop.
- Now we need to update our basic framework to be iOS specific. If you are doing cross platform development (such as for android and iphone), you will want to learn the phonegap commands more thoroughly. In my case, I need just the iOS specific framework to get going. In order to do this, type the following:
1 2
cd hello phonegap build ios
cd hello phonegap build ios
- If you analyze the folder structure now, you will see the “platforms/ios” subfolder. Inside is what you are looking for!
- Open the .xcodeproj file in the xcode app and you should feel at home once again.
I can certainly see why they changed things to streamline their PhoneGap Build product (online compiling in the cloud instead of locally like we are discussing here) but it does take a number of steps to get back into the standard xcode programming environment.