Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript
PhoneGap is Adobe's implementation of Cordova. PhoneGap also offers the PhoneGap Build service. This is not covered here.
Install from NPM. Install node.js if you don't have that)
sudo npm install -g cordova
// I had to do this first time:
sudo chown -R ade /usr/local/lib/node_modules/cordova/
// to update
sudo npm update -g cordova
// get version
cordova -v
cordova create AmazingApp com.adeweb.amazing "Amazing App"
cd AmazingApp/
cordova platform add ios
cordova platform add android
// list platforms added to this project
cordova platforms ls
// e.g.
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.network-information
cordova serve // run locally w/cordova API available
cordova build ios // alias for prepare + compile
cordova run android // run on attached device
You can also open the project in XCode or ADT and work from there.
alert("Platform is " + window.device.platform + " version " + window.device.version);