Install vs Build project with phonegap


Creating a Cordova Project

    1. Make sure an up-to-date version of Node.js is installed on your system.
    2. Open Terminal (Mac) or a Command window (Windows), and type the following command to install the Cordova CLI:
      1
      npm install -g cordova

      or on a Mac:

      1
      sudo npm install -g cordova
    3. Navigate to a directory where you store projects on your system. For example:
      1
      cd ~/Projects
    4. Create a project called “workshop”:
      1
      cordova create workshop com.yourname.workshop Workshop
    5. Navigate to the project directory:
      1
      cd workshop
    6. Add the platforms you want to support. For example, to add support for iOS and Android, type:
1
2
cordova platforms add ios
cordova platforms add android
  1. Make sure you are in the “workshop” directory, and add basic plugins to your projects:
    1
    2
    cordova plugin add org.apache.cordova.device
    cordova plugin add org.apache.cordova.console

Building a Cordova Project

iOS

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

1
cordova 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:

1
sudo npm install -g ios-sim

Then run the application in the iOS emulator:

1
cordova emulate ios

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:

1
cordova run android

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

1
cordova emulate android

 http://coenraets.org/blog/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: