With the popularity of Ionic and the hybridization of web/phone apps, any web developer with even a passing interest in producing phone apps should prepare their environment to do so. In this post, I will walk through the steps of creating an Ionic Android app, using Linux.

Ionic is an open-source, hybrid mobile/web platform for developing mobile apps using HTML5, CSS, and Javascript components; specifically AngularJS. As of this writing, it is among the top 40 most popular open source projects on Github with over 16,000 stars. Ionic's developer Drifty also claims an estimated 500,000 apps have been built with the development kit, and it only reached alpha status in November 2013.

Ionic can be used to build Android and iOS apps, and I recently developed an app for Android. After spending a considerable amount of time preparing my Ubuntu 14.10 machine for this purpose, I've compiled varied and scattered resources on the topic.

To develop for iOS using Ionic/Cordova, you will need to take additional steps if you are not running OS X, including using OpenSSL to generate a private key for use in signing your app. But I will focus on Android-specific development here.

The first step is to test whether java is installed, so type

java -version

If you see a java version number, you can skip ahead to the installation of the android development kit.

Otherwise, type

sudo apt-get update && sudo apt-get install default-jdk

to install OpenJDK. OpenJDK version is functionally the same as Oracle's distribution, which Oracle engineers claim is based on the open-source version.

Alternately, you can download the JDK directly from Oracle here. Select your OS architecture and flavor (x86 or x64, Windows or OS X, etc.), accept the Oracle Binary Code License Agreement, and download the archive.

Once Java is installed, you will need to install the Android development kit as well. Navigate here and click the 'Download - Installing the SDK' link on the left sidebar. Unzip the file by using the command

tar zxvf android-sdk_r24.1.2-linux.tgz

Now, we have to make sure that we have defined the paths properly. If the archive was unzipped in your home directory, open the ~/.bashrc file and add these lines:

export PATH=${PATH}:~/android-sdk-linux/tools export PATH=${PATH}:~/android-sdk-linux/platform-tools

We are almost finished, but we need to install Apache Cordova and Ionic on Ubuntu. We can use Node Package Manager for this, and if this is not installed, open the terminal and enter:

sudo apt-get install nodejs


sudo npm install npm -g

to get the latest version.

Now, to install Cordova and Ionic, enter:

sudo npm install -g cordova


sudo npm install -g ionic

using the -g flag to install globally on your machine.

You can now create a new template and begin working. You can select a starter project at http://ionicframework.com/getting-started/, such as the side menu template, using

ionic start myApp sidemenu

to create a new project that you can use to learn Ionic. Remember to consult AngularJS documentation for information on developing for Ionic.

Good luck!