Wednesday, October 25, 2017

Install Ionic CLI


Getting Started With Ionic 3-Installing Ionic

Ionic apps are created and developed primarily through the Ionic command line utility (the “CLI”), and use Cordova to build and deploy as a native app. This means we need to install a few utilities to get developing.

1. Ionic CLI and Cordova

To create Ionic projects, you’ll need to install the latest version of the CLI and Cordova. Before you do that, you’ll need a recent version of Node.js. Download the installer for Node.js 6 or greater and then proceed to install the Ionic CLI and Cordova for native app development:

$ npm install -g ionic cordova

You may need to add “sudo” in front of these commands to install the utilities globally

2. Start Ionic Project

Once that’s done, create your first Ionic app:

$ ionic start cutePuppyPics

Add –type ionic1 if you’d like to use Ionic 1. 
ie $ ionic start cutePuppyPics -type ionic1

3. Test Ionic Project In Browser

To run your app, cd into the directory that was created and then run the ionic serve command to test your app right in the browser!

$ cd cutePuppyPics

$ ionic serve

4. Try on Android

ionic cordova run android --device

5. Try on iOS

ionic cordova run ios --device

You may get an error such as

An error occurred while running cordova run ios --device (exit code 1).

Try running without device (emulator)

ionic cordova run ios

refer stackflow discussion at .




No comments:

Post a Comment