Search This Blog

Showing posts with label how to push app to android runnin gon vm. Show all posts
Showing posts with label how to push app to android runnin gon vm. Show all posts

Wednesday, May 17, 2017

Ionic app development on virtual machine with Android SDK


If you have planned to use virtual machine for mobile development and you have used VMware or virtual box to emulate the android device from ionic, this post is for you.

If your app is ready and working via the ionic serve, its right time to bundle and see if it can be deployed to the android device. There can be other reasons like you may want to test the Bar code or the GPS of your phone inside your app. In both the cases you will need to build the app for android via ionic and render it inside the android emulator.

In this section we will see how to quickly setup the android device emulator.
First you need to download the android sdk and run the installation.
https://developer.android.com/studio/index.html
Download and run the setup with Admin access.
If PATH and ANDROID_HOME are not updated after the install is complete, do that manually.
PATH – /sdk/tools
ANDROID_HOME – /sdk

Open new windows command prompts and test the path command by typing android, it should work.

Now its time to build our ionic app
> ionic build android

You might face an error on the build, about some license crap.
Follow the solution below.

======================================================
Can't accept license agreement Android SDK Platform 24
======================================================
Follow this
http://stackoverflow.com/questions/40383323/cant-accept-license-agreement-android-sdk-platform-24

If the build is successful proceed, else keep debugging it.


It should build the app, lets test if ionic is connected to the emulator.
> ionic emulate android

If android emulator doesn’t turn up, it could be a problem with your AVD(android virtual device) or the hardware virtualization is not enabled for your VM, I mentioned enabling the Intel Vtx setting of the processor on the vmware settings in the tutorial (How to build a hybrid mobile app using ionic ?)
vm processor android adb virtualization