Cordova basic commands and how to add and delete ins and cordova INS

Source: Internet
Author: User
Tags install node

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.