RUN IONIC APP ON ANDROID STUDIO EMULATOR

During development, it is good and highly encouraged to live test an app before releasing. This can be achieved by either using a smart phone or with android studio emulator.

Assuming the smart phone is not in good shape or you just want to use an emulator. How would you do it? Here is the solution.

Download and install android studio or lunch the emulator if you already having android studio installed.

Lunch visual studio code or any prefered code editor and bring up the internal terminal. Make sure you are in the ionic project folder. Run the command:

$ ionic cordova emulate android

With the emulator successfully running, app should compile without errors.

In case you are facing this error during project building:

...uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library...

It has to do with cordova-android@7.x.x. Cordova-android@7.x.x does not recognised android minSdkVersion with value=19 in config.xml inside ionic project folder. This was due to a bug solved in updated cordova versions.

This article works you through updating from v7 to latest version.