Setup & Install Ionic

By Justin

Setup & Install Ionic
Ionic is a framework for building native mobile apps using web technologies. The related docs are here.
Ionic is built on Angular so you'll definitely want to know some Angular and TypeScript before jumping in.
This guide is to help you install Ionic and even run a basic build. If you know Angular, you can probably already build a solid Ionic app with little trouble. So after you do some of the basic installs, you might play around with the code generated.
==================

1. Install Node.js from here

After downloading Node.js, the node package manager (npm) should automatically be installed. Test it out by doing:
$ npm --version

2. Install Ionic & Cordova

npm install -g cordova ionic

3. Create a new App

$ cd ~/Dev # or whatever you'd liek
$ mkdir new-proj
$ cd new-proj 
$ ionic start cfeApp sidemenu
Start options include:
  • ionic start blank
  • ionic start tabs
  • ionic start sidemenu

4. Run Newly Created App

$ ionic serve --open

5. Build App

$ ionic build --prod 

6. Test Web App

$ npm install -g http-server

$ http-server www/

7. Add Platform (optional step)

iOS
$ xcode-select install
Now, add to your project
$ cd path/to/your/ionic/proj 
$ ionic cordova platform add ios
Emulate
$ ionic cordova emulate ios
Build & Release
$ ionic cordova build ios --prod --release
Android
Add
$ ionic cordova platform add andriod
Emulate
$ ionic cordova emulate andriod
Build & Release
$ ionic cordova build andriod --prod --release
Discover Posts