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
- Download Android Studio from the Android website. More detailed installation instructions can be found in the User Guide.
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.
- Click Create Virtual Device and select a suitable device definition. For example like picture below:
Step 3 : Installing Gradle
- Can go to this website: https://gradle.org/install/
- Follow steps for Installing manually until you can check your gradle version.
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 !!!