cordova命令行基础

安装cordova,必须先安装 node.js
windows:
npm install -g cordova

ios & linux:
sudo npm install -g cordova

Create the App:
cordova create DirectoryName com.package.name ProjectName

Add/Remove/ls Platforms:
cd DirectoryName

cordova platform add android
cordova platform add ios
cordova platform add amazon-fireos
cordova platform add blackberry10
cordova platform add firefoxos


cordova platforms ls

cordova platform rm android



Build the App:
cordova build
cordova build ios
cordova prepare ios
cordova compile ios


Test the App on an Emulator or Device:
cordova emulate android
cordova run android



Add Plugin Features:
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.network-information
cordova plugin add org.apache.cordova.battery-status
cordova plugin add org.apache.cordova.device-motion
cordova plugin add org.apache.cordova.device-orientation
cordova plugin add org.apache.cordova.geolocation
cordova plugin add org.apache.cordova.camera
cordova plugin add org.apache.cordova.media-capture
cordova plugin add org.apache.cordova.media
cordova plugin add org.apache.cordova.file
cordova plugin add org.apache.cordova.file-transfer
cordova plugin add org.apache.cordova.dialogs
cordova plugin add org.apache.cordova.vibration
cordova plugin add org.apache.cordova.contacts
cordova plugin add org.apache.cordova.globalization
cordova plugin add org.apache.cordova.splashscreen
cordova plugin add org.apache.cordova.inappbrowser
cordova plugin add org.apache.cordova.console



cordova plugin ls

cordova plugin rm org.apache.cordova.console
---or---
cordova plugin remove org.apache.cordova.console



Help Commands:
cordova help
---or---
cordova

cordova info


Updating Cordova and Your Project:
cordova -v
sudo npm update -g cordova
npm info cordova


cordova platform update android
cordova platform update ios

...etc.

你可能感兴趣的:(ios,android)