How to Set Up Ionic/Cordova Environment
This tutorial is for Linux, not Mac!
First, download Android Studio
and extract the folder in /usr/bin
execute /bin/studio.sh
Set ANDROID_HOME
1 | export ANDROID_HOME=/home/kelly/Android/Sdk |
Second, install Java 8
https://tecadmin.net/install-oracle-java-8-ubuntu-via-ppa/
Set JAVA_HOME and JRE_HOME1
2JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
Third, install Gradleexport GRADLE_HOME=/usr/bin/android-studio/gradle/gradle-3.2
add GRADLE_HOME/bin
into PATH1
export PATH="$GRADLE_HOME/bin:/usr/bin/android-studio/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"
Now run ionic cordova build android
if you see license problem, try:1
2mkdir "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
Finally, set up Virtual Device using Android Studio
https://developer.android.com/studio/run/managing-avds.html