02_Run/build App in Android Emulator

Hi All,

Today I am going to show on how to Run an Build our ionic app in Android Emulator.

Step 1 : Installing Android Studio

Step 2 : Creating an Android Virtual Device

  • In the Android Studio welcome screen, click Configure » AVD Manager. The AVD Manager can also be opened inside Android projects in the Tools » AVD Manager menu.

AVD Setup

  • Click Create Virtual Device and select a suitable device definition. For example like picture below:

Step 3 : Installing Gradle

Step 4 : Download jdk 1.8

1- Install version Java 8 Follow this link

2- Update your environment variables:

  • JAVA_HOME if you installed the JDK
  • JRE_HOME if you installed the JRE

by pointing them to the location where the JRE 8 and JDK 8 were installed.

// On my machine   
C:\Program Files\Java\jdk1.8.0_171 // JAVA_HOME
C:\Program Files\Java\jre1.8.0_171 // JRE_HOME

Open a new terminal session and run the command that was failing. It should work now like below.

Step 5 : Run the emulator

  • In terminal, check the list of Android emulator. Type this command:
ionic cordova emulate android --list

  • Lastly, we can run the Android emulator. Type this command:
ionic cordova emulate android --target = Nesus

In terminal, check the list of Android emulator. Type this command:

Voilla !!! DONE !!!