Getting Started with Ionic 2 Cli

Ionic2 provides platform to web developers ,build great mobile apps and Progressive Web Apps in a way that felt just like building websites. That means ,the standard HTML, CSS, and JavaScript you are using to build a website,will help you turn it into mobile magic.

Benefits of Ionic2 are as follow

  • Cross platform mobile development
  • Angular 2 powered
  • Write once, deploy on different platforms
  • Runs on browser and devices
  • Debug on browser
  • Navigation like native(Push & Pop,no url base navigation)
  • Template Synatax
  • ionicons
  • Tooling(ionic CLI)
  • Native Look & Feel
  • ES6 and Type Script etc…

Enough of introduction!!! , now let’s start with Installation

step 1:)

download and install node.js

step 2:)

install cordova ( a framework that enables development for cross patform apps with HTML, CSS and JavaScript)

npm install -g cordova (mac/linux user write sudo)

step 3:)

Install Ionic CLI (This installs the Ionic Command Line Interface into your workstation.)

npm install -g ionic@latest
To check the details of your installed ionic, simply run

ionic info

step 4:)(optional)

Install Typescript (TypeScript is a superset of JavaScript,
and works really well with Angular 2)

npm install -g typescript

step 5:)

Create ionic 2 application

ionic start myfirstapp –v2 (tab application)

or for tutorial project

ionic start myfirstapp tutorial –v2 (side menu application)

here –v2 specifies the ionic version 2

–v1 for ionic 1

you can get list of available templates by simple writing

ionic start –list

step 6:)

Run the application,first navigate to your working directory then

ionic serve


ionic serve -l


List Of Ionic2 CLI commands which might be useful when building the application

  1. Add new Page:

ionic generate page nameofthepage

2. Add new Platform like android and ios

ionic platform add android

ionic platform add ios

ionic platform add windows

ionic platform add browser

3. Build application for particular platform

Before running on device you must configure android studio for android application

ionic build android

To build for ios, you need to be using MacOs and have xCode installed. You also need two node modules installed globally. They just help in building and deploying the app.

npm install -g ios-deploy

npm install -g ios-sim version

ionic build ios

4. Run application on devices

ionic run andorid

ionic run ios

I hope you found this post helpful..Thank you for reading.


2 thoughts on “Getting Started with Ionic 2 Cli”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s