1. First downloadInstallation node.js
Enter node -v in the command prompt and the version number will be displayed to prove the installation is successful
2. Install cordova globally:
npm install -g cordova
Enter cordova -v in the command prompt to check the version number to prove that the installation is successful
3. Create APP
cordova create hello com.example.hello HelloWorld
Result:
4. Enter the project
cd hello
5. Check the platform installed on this machine
cordova platforms list
Result:
6. Add platform support to the project
cordova platform add android
For example, I am now adding support for the android platform to the project
Result:
Of course you can also add support for other platforms, provided that your machine has .
In 5, we checked what supported platforms and added them as needed
cordova platform add amazon-fireos cordova platform add android cordova platform add blackberry10 cordova platform add browser cordova platform add firefoxos cordova platform add webos cordova platform add windows cordova platform add wp8
7. Add cordova plug-in
For cordova 5.0+ and above, you can add plug-ins directly
cordova plugin add cordova-hot-code-push-plugin
Result:
Or install directly through the repo url (unstable)
cordova plugin add https://github.com/nordnet/cordova-hot-code-push.git
Or install a local plug-in
cordova plugin add E:\project\plugins\cordova-hot-code-push-local-dev-addon
8. View the plug-ins installed by the project
cordova plugin list
Result:
##9.Deleteplug-in
cordova plugin remove cordova-hot-code-push-plugin
cordova platform remove android
cordova build android
他会在 platforms/android/bin/ 下已经生成了 apk 文件
cordova emulate android
cordova run android
install -g cordova@3.1.0-0.2.0
cordova info
cordova help
cordova plugin add cordova-plugin-device@1.1.4
cordova emulate
The above is the detailed content of cordova basic commands. For more information, please follow other related articles on the PHP Chinese website!