Make sure you have an up-to-date version of Node.js installed on your system.
If you already have PhoneGap installed on your computer, make sure you upgrade to the latest version:
npm update -g phonegap
or
sudo npm update -g phonegap
Navigate (cd) to a directory where you store projects on your file system.
Using the PhoneGap CLI, create a PhoneGap project named Workshop in a directory named workshop:
phonegap create workshop com.yourname.workshop Workshop
Navigate into the project directory:
cd workshop
Add support for the iOS platform (optional)
phonegap platforms add ios
To be able to build for the iOS platform, the iOS SDK must be installed on your system. If it's not, you can skip this step and add support for another platform, or simply run the tutorial application in your browser.
Add support for the Android platform (optional)
phonegap platforms add android
To be able to build for the Android platform, the Android SDK must be installed on your system. If it's not, you can skip this step and add support for another platform, or simply run the tutorial application in your browser.
Make sure you are in the workshop directory, and add these basic plugins to your projects:
phonegap plugin add org.apache.cordova.console
phonegap plugin add org.apache.cordova.device
The console plugin is needed to see any console messages you might be writing in your app (console.log("My value is " + val)).
The device plugin allows you to access device specific information so you can detect platform (iOS, android etc), version etc.
Examine the directory structure under workshop.