Home  >  Article  >  Web Front-end  >  cordova basic commands

cordova basic commands

大家讲道理
大家讲道理Original
2018-05-15 11:38:482485browse

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
Result:

10. Remove platform support

cordova platform remove android
11. Compile the project

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

 cordova emulate android
Run app project (in a virtual machine or 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. Restart Compile

cordova emulate
rrree

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

Statement:
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