Ionic Environment Setup
Ionic apps are created and developed primarily through the Ionic command-line utility. The Ionic CLI is the preferred method of installation, as it offers a wide range of dev tools and helps options along the way. It is also the main tool through which to run the app and connect it to other services, such as Ionic Appflow. So let's start installing ionic with command line itself.
- NodeJS: This is the base platform needed to create Mobile Apps using Ionic. You can find detail on the NodeJS installation in our NodeJS Environment Setup. Make sure you also install npm while installing NodeJS.
- Android SDK: If you are going to work on a Windows platform and are developing your apps for the Android platform, then you should have Android SDK setup on your machine.
- XCode: If you are going to work on the Mac platform and are developing your apps for the iOS platform, then you should have XCode setup on your machine.
- cordova and Ionic: These are the main SDKs which is needed to start working with Ionic. This section we will explain how to setup Ionic in a simple step.
Install the Ionic CLI
Before proceeding, make sure the latest version of Node.js and npm are installed. See Environment Setup for details. Install the Ionic CLI globally with npm:
npm install -g ionic
-gmeans it is a global install. For Window’s it's recommended to open an Admin command prompt. For Mac/Linux, run the command with
Start an App
Create an Ionic app using one of the pre-made app templates, or a blank one to start fresh. The three most common starters are the
tabs starter, and
sidemenustarter. Get started with the
ionic start command:
ionic start myApp tabs
Run the App
The majority of Ionic app development can be spent right in the browser using the
ionic serve command:
$ cd myApp $ ionic serve
There are a number of other ways to run an app, it's recommended to start with this workflow. To develop and test apps on devices and emulators, see the Running an App Guide.