First touch of Ionic 2
2016-05-10 15:08
141 查看
Please note that we use Ubuntu/Debian in this blog.
Here we suppose that you already have your NodeJS and npm, then just type
in your terminal to install ionic 2.
in your terminal. After typing the command above, ionic will automatically generate a standard project.
Then you can just type
to build the project as well as run it on the browser.
As Ionic 2 is a hybrid app development SDK, you can also build app on Android and iOS by typing
or
Please note that you can also add
Attention: Only computer with Mac OS can build iOS app. To build and deploy your project, you MUST have corresponding SDK.
Tips: To install Android SDK, you can simply install an Android Studio on your computer to manage SDK.
Also, you can add a parameter
For instance:
Tips: You can install adb by typing
Resume
Ionic 2 is a useful SDK for hybird mobile app development (which means that you can produce your app on different platform). With ionic 2, we can simply build app on Android/iOS/Windows Phone(Hasn’t been released officially until now) without major modifications. Ionic 2 is based on AngularJS 2 and web technologies such as HTML, CSS and SASS (Which is a pre-compile CSS format).Install
To install ionic, you should have NodeJS and npm first.Here we suppose that you already have your NodeJS and npm, then just type
npm install -g ionic@beta
in your terminal to install ionic 2.
Hello World! and build
To create a project, just typeionic start HelloWorld --v2
in your terminal. After typing the command above, ionic will automatically generate a standard project.
Then you can just type
ionic serve
to build the project as well as run it on the browser.
As Ionic 2 is a hybrid app development SDK, you can also build app on Android and iOS by typing
ionic build android
or
ionic build android.
Please note that you can also add
--v2to force using Ionic 2 for you compilation and also add
--tsto enable TypeScript support.
Attention: Only computer with Mac OS can build iOS app. To build and deploy your project, you MUST have corresponding SDK.
Tips: To install Android SDK, you can simply install an Android Studio on your computer to manage SDK.
Test your project
In order to test your project easily, you can useionic run androidto deploy your app on your Android device as well as you can type
ionic run iosto deploy on your iOS device.
Also, you can add a parameter
--device=YOUR_DEVICE_IDto specify a device that you want to deploy your app.
For instance:
ionic run android --device=abcd00000
Tips: You can install adb by typing
sudo apt-get install adbto list devices that are connected to your computer.
相关文章推荐
- hdu4764 2013长春网赛
- Android自动化测试(UiAutomator)简要介绍[java] view plaincopy package com; import com.android.uiautomator.co
- 124.Perfect Squares
- 基于MT7688模块的开发笔记10——通过TFTP实现Ubuntu与开发板之间的文件传输
- 字符串转LinkList
- What’s the difference between machine learning, statistics, and data mining?
- Erlang NIF简析
- 二分查找与判定树
- 栈与队列相关笔试题
- 配置运行ASP程序 在64位IIS 7下经验
- java注解的理解
- Linux 与 BSD 有什么不同?
- 287. Find the Duplicate Number
- bzoj4460
- Struts1 和 Struts2区别
- 通过学习学生信息管理系统软件,C程序中,如何设计和编写一个应用系统
- 通过mac地址查询ip
- centos 6.7 ssh 免密码
- SQL Server与SQL Server Express的区别
- 开源Android-PullToRefresh下拉刷新源码分析