「Ionic」創建新項目
1.創建新項目
创建一个名为myApp的还有tabs的项目(ionic start <project-name> <optional-template>) 可选模板为sidemenu 侧滑、tabs 底部tab切换、blank 空白):
libotaodeMacBook-Pro:~ libotao$ cd /Users/libotao/WorkSpaces/Ionic
libotaodeMacBook-Pro:Ionic libotao$ ionic start myApp tabs
--------------------------------
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following: Please install your Cordova CLI to version >=4.2. `npm install -g cordova`
Install ios-sim to deploy iOS applications.`npm install -g ios-sim` (may require sudo)
Install ios-deploy to deploy iOS applications to devices. `npm install -g ios-deploy` (may require sudo) ******************************************************
Creating Ionic app in folder /Users/libotao/WorkSpaces/Ionic/myApp based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================] % .0s
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================] % .0s
Installing npm packages... Adding initial native plugins
[=============================] % .0s Adding in iOS application by default
add to body class: platform-ios
Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip
[=============================] % .0s
Saving your Ionic app state of platforms and plugins
Saved platform
Saved plugins
Saved package.json ♬ ♫ ♬ ♫ Your Ionic app is ready to go! ♬ ♫ ♬ ♫ Some helpful tips: Run your app in the browser (great for initial development):
ionic serve Run on a device or simulator:
ionic run ios[android,browser] Test and share your app on device with Ionic View:
http://view.ionic.io Build better Enterprise apps with expert Ionic support:
http://ionic.io/enterprise Create an Ionic Cloud account to add features like User Authentication, Push Notifications, Live Updating, iOS builds, and more?
(Y/n): N
2、打開這個項目文件夾
libotaodeMacBook-Pro:Ionic libotao$ cd myApp
3、在瀏覽器中預覽
libotaodeMacBook-Pro:myApp libotao$ ionic serve Multiple addresses available.
Please select which address to use by entering its number from the list below:
) 192.168.31.138 (en0)
) localhost
Address Selection: localhost
Selected address: localhost
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit ionic $

4、添加iOS和android平台項目文件
执行下面命令
ionic platform add ios
ionic platform add android
时间实在是太长了,直接执行吧。
在项目文件夹就会看到平台支持文件了,用xcode直接打开ios项目运行即可。
以下为安卓操作,没有实际测试,请自行测试。
5、安卓中生成apk
ionic build android
6、在模拟器上运行
ionic emulate android
7、把5、6合并运行
ionic run android
「Ionic」創建新項目的更多相关文章
- 利用CMD 創建新文件的機種方法
用 CMD 創建新文件 説明一下: 是在Windows的 CMD命令行模式下,或者在PowerShell命令行模式下創建新文件的機種方法. 創建空文件 cd.>a.txt cd.表示改变当前目录 ...
- 「JLOI2014」松鼠的新家
「JLOI2014」松鼠的新家 传送门 两种做法: 树上差分 \(O(n)\) 树链剖分 \(O(nlogn)\) 树剖比较好写而且无脑,树上差分复杂度优秀一些但是会有点难调. 这里给出树剖写法: 唯 ...
- 「Ionic」设置开发环境
轉載請一定註明地址:http://www.cnblogs.com/surge/p/5983024.html 謝謝! 濤叔是在mac環境下進行的,涉及android環境的配置不保證成功. 少废话,跟着濤 ...
- 「Ionic」WebStorm的使用錯誤-
前言:遇到這個錯誤,不要慌張,搶按照濤叔下面的方式處理就可以了. 1.Couldn't find ionic.config.json file. Are you in an Ionic project ...
- 「Ionic」使用chrom時的跨域問題
前言:在angularjs請求數據時,會遇到跨域問題,解決辦法有很多,但是都不是我想要的(很多人云亦云,都解決不了問題).如果你只是想在本機測試使用,可以參考如下設置. 具體辦法: 1.在电脑上新 ...
- 使用 docsify 創建自己的 markdown 文檔系統
先來看一下我在碼雲上創建的demo: http://lin1270.gitee.io/nicedoc/#/ GIT自己clone一下: https://gitee.com/lin1270/nicedo ...
- 使用TFS創建團隊項目
使用微軟賬號登錄Team Service,關聯一個TS賬戶,用來存放你所有的項目,可以從瀏覽器中直接訪問,地址類似yourname.visualstudio.com. 詳細鏈接 在TS賬戶主面板中,可 ...
- 怎样創建 iOS 展開式 UITableView?
原文:http://www.appcoda.com.tw/expandable-table-view/ 译者:kmyhy(appcoda的驻站译者) 幾乎全部的 App 都會以導航的方式向用戶展示多個 ...
- 摹客iDoc「标注」新玩法!这些细节让你爱不释手(201903-2版本更新)
哈喽小伙伴们,我们又见面啦!没错,小摹就是来告诉大家:摹客iDoc又双叒叕升级了!这次又上线了许多新玩法,在此之前,小摹先带大家温习一下iDoc以往的知识点: 攻城狮查看标注的利器 —— 标注信息智能 ...
随机推荐
- fir.im Weekly - 做一款 App 需要考虑什么
开发 App 是一个痛并快乐的旅程.工具越来越多,成本也越来越低,那么在开发之前需要考虑些什么?limboy 总结了一些经验和反思--做一个 App 前需要考虑的几件事,参考一下为你的 App 多留点 ...
- fir.im Weekly - 不能错过的 GitHub Top 100 开源库
好的工具&资源,会带来更多的灵感.本期 fir.im Weekly 精选了一些实用的 iOS,Android 的使用工具和源码分享,还有前端.UI方面的干货.一起来看下:) Swift 开源项 ...
- 每天一个linux命令(17):whereis 命令
whereis命令只能用于程序名的搜索,而且只搜索二进制文件(参数-b).man说明文件(参数-m)和源代码文件(参数-s).如果省略参数,则返回所有信息. 和find相比,whereis查找的速度非 ...
- hibernate(六) cascade(级联)和inverse关系详解
序言 写这篇文章之前,自己也查了很多的资料来搞清楚这两者的关系和各自所做的事情,但是百度一搜,大多数博文感觉说的云里雾里,可能博主自己清楚是怎么一回事,但是给一个不懂的人或者一知半解的人看的话,别人也 ...
- 快速入门系列--NOSQL--07MongoDB
从我第一次听到Nosql这个概念到如今已经走过4个年头了,但仍然没有具体的去做过相应的实践.最近获得一段学习休息时间,购买了Nosql技术实践一书,正在慢慢的学习.在主流观点中,Nosql大体分为4类 ...
- JAVA EE Hibernate基础一之环境配置
对于JAVA开发高级,hibernate是java三大框架之一,足以见得它的重要性,那么对于hibernate的使用大家有了解多少呢?从今天开始我将带领大家一道共同探讨一下hibernate的知识,h ...
- Android线程之并发处理
上一篇为大家介绍了关于Looper的简单知识,本篇我们介绍一下多线程的并发处理,我们知道Handler通过sendMessage()发送的消息,首先发送给了Looper,存入Looper的消息栈,之后 ...
- Codrops 教程:基于 CSS3 的精美模态窗口效果
Codrops 分享了漂亮的模态窗口效果实现方法,希望给前端开发人员提供一些创新显示对话框的启示.这个方案使用了触发按钮(或任何的 HTML 元素),在点击的时候出现一个模态窗口,带有简单的过渡(或动 ...
- Android监听来电和去电
要监听android打电话和接电话,只需下面2步骤1.第一步,写一个Receiver继承自BroadcastReceiver import android.app.Service; import an ...
- Twitter Bootstrap深受开发者喜爱的11大理由
Bootstrap,作为创新技术框架,使开发者.设计者更容易.更快捷.更出色地完成网站及应用的搭建工作.如果你还没有使用Twitter Bootstrap,建议你去了解一下.Bootstrap为开发者 ...