「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以往的知识点: 攻城狮查看标注的利器 —— 标注信息智能 ...
随机推荐
- Java面试(2)-- Java算数表达式
class Demo02{ public static void main(String[] args){ //算数运算符 +,-,*,/,%,++,-- //例1 int a = 1; int b ...
- 用scrollTop制作一个自动滚动公告栏
我们在浏览网页时,经常会看到会一些滚动的栏目,比如向上滚动的公告.新闻等.其实他们的制作都不难,只要学了基础的html.css.javascript就可以做出来,用JavaScript的scrollT ...
- jquery-toastmessage-plugin 简介信息
jquery-toastmessage-plugin 简介信息 jquery-toastmessage-plugin是一个JQuery插件实现了类似于android的消息通知对话框.它提供4种消息提醒 ...
- Java-集合(没做出来)第四题 (List)写一个函数reverseList,该函数能够接受一个List,然后把该List 倒序排列。 例如: List list = new ArrayList(); list.add(“Hello”); list.add(“World”); list.add(“Learn”); //此时list 为Hello World Learn reverseL
没做出来 第四题 (List)写一个函数reverseList,该函数能够接受一个List,然后把该List 倒序排列. 例如: List list = new ArrayList(); list.a ...
- 使用swoole和websocket结合来制造弹幕
在知乎上无意中看到了一篇有关这个的话题https://zhuanlan.zhihu.com/p/23992890,刚好没事也好久没弄swoole了就自己按照知乎上的那篇文站实操了一下 那个试验中有几个 ...
- @import导入外部样式表与link链入外部样式表的区别
昨天碰到同事问了一个问题,@impor导入外部样式与link链入外部样式的优先级是怎样的,为什么实验的结果是按照样式表导入后的位置来决定优先级. 今天就这个问题,度娘上找了很久,终于有个总结性的答案出 ...
- SeaJS与RequireJS最大的区别
SeaJS与RequireJS最大的区别 U_U 2013-06-20 16:21:12 执行模块的机制大不一样-----------------------------------由于 Requir ...
- Android入门(十三)内容提供器
原文链接:http://www.orlion.ga/612/ 内容提供器(Content Provider)主要用于在不同的应用程序之间实现数据共享的功能,它提供了一套完整的机制,允许一个程序访问另一 ...
- 移动web开发之像素和DPR
× 目录 [1]定义 [2]分类 [3]缩放[4]DPR 前面的话 像素在web开发中几乎天天用到,但到底什么是像素,移动端和桌面端的像素有区别吗,缩放对像素有影响吗,视网膜屏幕和像素有什么关系?关于 ...
- 邻接矩阵无向图(一)之 C语言详解
本章介绍邻接矩阵无向图.在"图的理论基础"中已经对图进行了理论介绍,这里就不再对图的概念进行重复说明了.和以往一样,本文会先给出C语言的实现:后续再分别给出C++和Java版本的实 ...