Ionic is a fantastic framework—sort of like the Twitter Bootstrap of native development—that allows you to quickly develop pretty, modern-looking native apps that run on both Android and iOS devices.
It's quite straightforward to get started developing with Ionic and testing with your browser, but setting up the Android emulator to work properly is fairly complicated, at least on Linux machines.
The simple documentation on IonicFramework.com does not explain how to install all the Android dependencies on Ubuntu.
Here are the steps that you can take to install and configure all the necessary Ionic dependencies on Ubuntu. I tested this on Ubuntu 13.10.
First, install Ionic and Cordova:
sudo npm install -g cordova ionic
Next, install ia32-libs:
sudo apt-get install ia32-libs
sudo apt-get install openjdk-7-jdk
Next, download the Android SDK from http://developer.android.com/sdk/index.html
Unzip the downloaded file adt-bundle-linux-x86_64-20140702.zip (your version number may be slightly different). You should see a folder with two subfolders, called eclipse and sdk.
In the newly opened nautilus window create a folder called "android-sdk-linux"
Copy the entire contents of the sdk folder from the unzipped archive to this new folder "android-sdk-linux"
Run these two commands:
If you've done everything right so far, you should see the Android SDK Manager open.
Next, edit your ~/.bashrc file and add the following lines to the top of the file:
Reload bash so that your ~/.bashrc changes take effect:
Now, create an Android Virtual Device (AVD):
android create avd -n android-19 -t 1 --abi default/armeabi-v7a
In order to see which target virtual devices you have available, run this command:
android list targets
If you don't create an Android Virtual Device, you are likely to get this unfriendly error when running ionic build android:
Waiting for emulator...
emulator: ERROR: This AVD's configuration is missing a kernel file!!
Now the simple Ionic commands should work:
ionic build android
ionic emulate android