Home > Web Front-end > JS Tutorial > cordova basic commands

cordova basic commands

大家讲道理
Release: 2018-05-15 11:38:48
Original
2635 people have browsed it

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
Copy after login

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
Copy after login

Result:

4. Enter the project

cd hello
Copy after login

5. Check the platform installed on this machine

cordova platforms list
Copy after login

Result:

6. Add platform support to the project

cordova platform add android
Copy after login

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
Copy after login

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
Copy after login

Result:

Or install directly through the repo url (unstable)

cordova plugin add https://github.com/nordnet/cordova-hot-code-push.git
Copy after login

Or install a local plug-in

cordova plugin add E:\project\plugins\cordova-hot-code-push-local-dev-addon
Copy after login

8. View the plug-ins installed by the project

cordova plugin list
Copy after login

Result:

##9.

Deleteplug-in

cordova plugin remove cordova-hot-code-push-plugin
Copy after login
Result:

10. Remove platform support

cordova platform remove android
Copy after login
11. Compile the project

cordova build android
Copy after login
他会在 platforms/android/bin/ 下已经生成了 apk 文件
Copy after login
or start the android virtual machine:

 cordova emulate android
Copy after login
Run app project (in a virtual machine or a real machine):

 cordova run android
Copy after login
12. Install the specified version of cordova

install -g cordova@3.1.0-0.2.0
Copy after login
13. View the list of installed plug-ins and the environment version

cordova info
Copy after login
Result:

14. View all cordova commands

cordova help
Copy after login
15. Install the plug-in with the specified version number

cordova plugin add cordova-plugin-device@1.1.4
Copy after login
16. Restart Compile

cordova emulate
Copy after login
rrree

The above is the detailed content of cordova basic commands. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template