Module 2: Building a PhoneGap Project

This module is optional. If you didn't add support for any platform in the previous module, you can skip this module and go to module 3.

Building for iOS

You need the iOS SDK installed on your computer to build an iOS version of your application using the steps below.

On the command line, make sure you are in the workshop directory and type:

phonegap build ios

The project is built in the workshop/platforms/ios folder. Double-click Workshop.xcodeproj to open the project in Xcode, and run it in the emulator or on your device.

You can also run the application in the iOS emulator directly from the command line. First install ios-sim:

npm install -g ios-sim

or

sudo npm install -g ios-sim

Then run the application in the iOS emulator:

phonegap emulate ios

Building for Android

You need the Android SDK installed on your computer to build an Android version of your application using the steps below.

To build the project in the workshop/platforms/android folder and run it on an Android device connected to your computer using a USB cable, type:

phonegap run android

To build the project in the workshop/platforms/android folder and run it in the Android emulator, type:

phonegap emulate android