码迷,mamicode.com
首页 > 其他好文 > 详细

Cordova-完整的示例

时间:2018-03-05 14:08:46      阅读:741      评论:0      收藏:0      [点我收藏+]

标签:get   browser   logo   page   localhost   build   x64   format   not   

//全局安装cordova
C:\Users\Administrator>npm i -g cordova H:\Node\node-v8.9.4-win-x64\cordova -> H:\Node\node-v8.9.4-win-x64\node_modulescordova\bin\cordova + cordova@8.0.0 added 409 packages in 60.396s //查看示例以及命令
C:\Users\Administrator>cordova Synopsis cordova command [options] Global Commands create ............................. Create a project help ............................... Get help for a command telemetry .......................... Turn telemetry collection on or off config ............................. Set, get, delete, edit, and list global cordova options Project Commands info ............................... Generate project information requirements ....................... Checks and print out all the requiremen ts for platforms specified platform ........................... Manage project platforms plugin ............................. Manage project plugins prepare ............................ Copy files into platform(s) for buildin g compile ............................ Build platform(s) clean .............................. Cleanup project from build artifacts run ................................ Run project (including prepare && compile) serve .............................. Run project with a local webserver (including prepare) Learn more about command options using ‘cordova help <command>‘ Aliases build -> cordova prepare && cordova compile emulate -> cordova run --emulator Options -v, --version ...................... prints out this utility‘s version -d, --verbose ...................... debug mode produces verbose log output for all activity, --no-update-notifier ............... disables check for CLI updates --nohooks .......................... suppress executing hooks (taking RegExp hook patterns as paramet ers) Examples
  //官方自带示例 cordova create myApp org.apache.cordova.myApp myApp cordova plugin add cordova-plugin-camera cordova platform add android cordova plugin add cordova-plugin-camera --nosave cordova platform add android --nosave cordova requirements android cordova build android --verbose cordova run android cordova build android --release -- --keystore="..\android.keystore" --storeP assword=android --alias=mykey cordova config ls C:\Users\Administrator>cd Desktop C:\Users\Administrator\Desktop>cordova create myApp org.apache.cordova.myApp myA pp Creating a new cordova project. C:\Users\Administrator\Desktop>cd myApp //你需要添加你想构建app的平台
C:\Users\Administrator\Desktop\myApp>cordova platform add browser Using cordova-fetch for cordova-browser@~5.0.1 Adding browser project... Creating Cordova project for cordova-browser: Path: C:\Users\Administrator\Desktop\myApp\platforms\browser Name: myApp Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the pro ject Installing "cordova-plugin-whitelist" for browser Adding cordova-plugin-whitelist to package.json Saved plugin info for "cordova-plugin-whitelist" to config.xml --save flag or autosave detected Saving browser@~5.0.3 into config.xml file ... //在浏览器环境下App运行 C:\Users\Administrator\Desktop\myApp>cordova run browser startPage = index.html Static file server running @ http://localhost:8000/index.html CTRL + C to shut down 200 /index.html (gzip) 200 /css/index.css (gzip) 200 /js/index.js (gzip) 200 /cordova.js (gzip) 200 /img/logo.png 200 /cordova_plugins.js 200 /favicon.ico (gzip) 304 /css/index.css

详情请参见:Cordova官网

Cordova-完整的示例

标签:get   browser   logo   page   localhost   build   x64   format   not   

原文地址:https://www.cnblogs.com/cisum/p/8508605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!