Phonegap Cheatsheet – Part 1

This is an phonegap cheatsheet for phonegap installation and project creation (for beginners). you can use them for your phonegap project

Cordova Installation : 

npm install -g cordova

if you need particular version of cordova you can install using following command

npm install -g cordova@version

npm install -g cordova@4.2.0

Cordova Uninstall

If you want to uninstall cordova, you can uninstall using this command

npm uninstall -g cordova

Working with phonegap projects

1. Create New phonegap / apache cordova projects (cordova create FolderName com.company.appName AppName)

cordova create HelloWorld com.phonegap.hello Hello

2. Change Directory (cd DirectoryName)

cd HelloWorld

3. Adding platform (cordova platform add PlatformName)

cordova platform add android
cordova platform add ios

4. Add Plugin (cordova plugin add PluginName)

cordova plugin add org.apache.cordova.device-info

5. Building / compile phonegap projects (cordova build)

cordova build is used for building your application for  all platforms which you added such as android, ios, windows.if you want to build for particular os, you can use following command

cordova build android
cordova build ios

6. Emulating on emulator (cordova emulate)

cordova emulate is used for emulating your project for all platforms which you added such as android, ios, windows.if you want to emulate for particular os, you can use following command

cordova emulate android
cordova emulate ios

Share This

Share this post with your friends!