Linux Format

Building and testing with Cordova and Ionic


If you have issues, they can normally be cleared up with some simple edits to the .bashrc file, or Java may need a bit of a makeover.

For starters, if the ANDROID_HOME path is off you can find it in Android Studio by loading a working app then locating the path by clicking Tool > Android > SDK Manager. At the top, you will see the path and that will become ANDROID_HOME.

With Java, you could install the Java JDK from Oracle after downloadin­g using simple directions from linux_x64_install.xml. In this case, the folder /usr/java was created and the downloaded tar file was moved to that folder. After extraction, the new folder jdk1.8.0_121 is created. This becomes JAVA_HOME. You will likely want to uninstall and remove old versions which could reside in the folder /usr/lib/jvm/. export JAVA_HOME='/usr/java/jdk1.8.0_121’ export ANDROID_HOME='/home/ myusername/Android/Sdk’ export PATH=${PATH}:$ANDROID_HOME/ platform-tools:$ANDROID_HOME/tools

After making changes to .bashrc you can run the command source ~\.bashrc, open a new terminal and see if both paths have been set using the following:


Now you can build and run again using the commands mentioned earlier.

To load the project into Android Studio, use File > Open > Select App folder > Platforms > Android. Android will guide you through a setup process after that, and make sure to choose an SDK when prompted.

Now you can test your Cordova app or Ionic app just as you would a native app. One key note is that you can add many other plugins to Cordova to perform functions such as get geolocatio­n and to store data.

Newspapers in English

Newspapers from Australia