Cordova basic commands and how to add and delete ins and cordova INS
1. First download and install node. js
Enter node-v in the command prompt and the version number is displayed to verify that the installation is successful.
2. Global installation of cordova:
npm install -g cordova
Enter cordova-v in the command prompt to check that the installation is successful.
3. Create an APP
cordova create hello com.example.hello HelloWorld
Result:
4. Enter the project
cd hello
5. view the platform installed on the local machine
cordova platforms list
Result:
6. Add platform support to the Project
cordova platform add android
For example, I now add android platform support to the Project
Result:
Of course, you can also add support from other platforms, provided that your local machine has.
In step 5, we checked the supported platforms and added them as needed.
cordova platform add amazon-fireoscordova platform add androidcordova platform add blackberry10cordova platform add browsercordova platform add firefoxoscordova platform add weboscordova platform add windowscordova platform add wp8
7. Add the cordova plugin
You can directly add plug-ins for more than 5.0 cordova
cordova plugin add cordova-hot-code-push-plugin
Result:
Or you can directly install it through the repo url (unstable)
cordova plugin add https://github.com/nordnet/cordova-hot-code-push.git
Or install the local plug-in.
cordova plugin add E:\project\plugins\cordova-hot-code-push-local-dev-addon
8. view the plug-ins installed in the project.
cordova plugin list
Result:
9. Delete the plug-in
cordova plugin remove cordova-hot-code-push-plugin
Result:
10. Deletion platform support
cordova platform remove android
11. compile the project
cordova build android
The apk file is generated under platforms/android/bin /.
Or start the android virtual machine:
cordova emulate android
Run the app Project (on a virtual machine or on a real machine ):
cordova run android
12. Install the specified version of cordova
install -g cordova@3.1.0-0.2.0
13. view the list of installed plug-ins and the Environment version
cordova info
Result:
14. View All cordova commands
cordova help
15. Install the plug-in with the specified version number
cordova plugin add cordova-plugin-device@1.1.4
16. recompile
cordova emulate