How to use Genymotion instead Android emulator


#1

Hi,

I just installed Genymotion to try it and would like to know if there is a way to run something like “ionic emulator android” and it is Genymotion that is used and not Android emulator.

If it is possible, would mind to give the steps?

Thanks


#2

First Install the Intel x86 Emulator Accelerator HAXM from the Android SDK manager next create a device in genymotion, Once its done, go to settings and then go to the ADB tab and select use genymotion android tools. Once done, run this command: ionic run android, so that ionic can detect the device created using genymotion. If you use ionic emulate android then ionic will not recognise your device.


#3

Hi @chandroiud,

Thanks for the info.

For some reason, on Windows, I have these below errors when trying to install the package. The path is right, but the files that are asked are not there because nothing got downloaded! You already encountered that issue before?

Fetching URL: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Validate XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Parse XML:    https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Done loading packages.
Preparing to install archives
Downloading Android SDK Tools, revision 25.1.6
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r25.1.6-windows.zip (Access is denied)
Downloading Android SDK Platform-tools, revision 23.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r23.1.0-windows.zip (Access is denied)
Downloading SDK Platform Android 6.0, API 23, revision 3
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-23_r03.zip (Access is denied)
Downloading Intel x86 Atom System Image, Android API 19, revision 5
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sysimg_x86-19_r05.zip (Access is denied)
Downloading Google APIs, Android API 19, revision 20
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\google_apis-19_r20.zip (Access is denied)
Done. Nothing was installed.
Done loading packages.
Preparing to install archives
Downloading Android SDK Tools, revision 25.1.6
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r25.1.6-windows.zip (Access is denied)
Downloading Android SDK Platform-tools, revision 23.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r23.1.0-windows.zip (Access is denied)
Downloading SDK Platform Android 6.0, API 23, revision 3
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-23_r03.zip (Access is denied)
Downloading Intel x86 Atom System Image, Android API 19, revision 5
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sysimg_x86-19_r05.zip (Access is denied)
Downloading Google APIs, Android API 19, revision 20
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\google_apis-19_r20.zip (Access is denied)
Downloading Intel x86 Emulator Accelerator (HAXM installer), revision 6.0.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\haxm-windows_r6_0_1.zip (Access is denied)
Done. Nothing was installed.
Done loading packages.
Preparing to install archives
Downloading Android SDK Tools, revision 25.1.6
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r25.1.6-windows.zip (Access is denied)
Downloading Android SDK Platform-tools, revision 23.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r23.1.0-windows.zip (Access is denied)
Downloading SDK Platform Android 6.0, API 23, revision 3
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-23_r03.zip (Access is denied)
Downloading Intel x86 Atom System Image, Android API 19, revision 5
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sysimg_x86-19_r05.zip (Access is denied)
Downloading Google APIs, Android API 19, revision 20
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\google_apis-19_r20.zip (Access is denied)
Downloading Intel x86 Emulator Accelerator (HAXM installer), revision 6.0.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\haxm-windows_r6_0_1.zip (Access is denied)
Done. Nothing was installed.
Done loading packages.
Preparing to install archives
Downloading Android SDK Tools, revision 25.1.6
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r25.1.6-windows.zip (Access is denied)
Downloading Android SDK Platform-tools, revision 23.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r23.1.0-windows.zip (Access is denied)
Downloading SDK Platform Android 6.0, API 23, revision 3
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-23_r03.zip (Access is denied)
Downloading Intel x86 Atom System Image, Android API 19, revision 5
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sysimg_x86-19_r05.zip (Access is denied)
Downloading Google APIs, Android API 19, revision 20
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\google_apis-19_r20.zip (Access is denied)
Downloading Intel x86 Emulator Accelerator (HAXM installer), revision 6.0.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\haxm-windows_r6_0_1.zip (Access is denied)
Done. Nothing was installed.
Preparing to install archives
Downloading Intel x86 Emulator Accelerator (HAXM installer), revision 6.0.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\haxm-windows_r6_0_1.zip (Access is denied)
Done. Nothing was installed.
Preparing to install archives
Downloading Android SDK Tools, revision 25.1.6
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r25.1.6-windows.zip (Access is denied)
Downloading Android SDK Platform-tools, revision 23.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r23.1.0-windows.zip (Access is denied)
Downloading SDK Platform Android 6.0, API 23, revision 3
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-23_r03.zip (Access is denied)
Downloading Intel x86 Emulator Accelerator (HAXM installer), revision 6.0.1
URL not found: C:\Program Files (x86)\Android\android-sdk\temp\haxm-windows_r6_0_1.zip (Access is denied)
Done. Nothing was installed.

#4

Well I haven’t worked on windows OS much from the logs I guess some access permission is denied for android sdk manager its not able create directories and write to them, You will need give administrator privileges to it, if it still doesn’t work the best alternative would be to download and install the android sdk once again. Download the complete bundle.


#5

Your suggestion to run the manager as admin was the right thing to do! :slight_smile:

I am now in the downloading process…

Thanks


#6

Just out of curiosity - is there any particular reason to use Genymotion and not the new Android emulator in Android Studio 2.0?


#7

Hi @iignatov,

I did not install Android Studio 2.0, just the SDK command line tool because I thought it would not be necessary to download the whole IDE if I am using only the Ionic and VS code tools.

I discovered that the emulator that was coming with the CLI was verrrrrrrrrrrrry slow on my machine.

I heard about Genymotion and often, the demos were using it too. So, I just gave it a try. It is faster, but not as fast as I thought. I still prefer to use Chrome and than a real phone.

But now, you seem to tell the emulator with 2.0 is working good, am I right? How do you use it? You have to run the IDE to make it work or it is not necessary?


#8

I still haven’t tried it myself (because I’m currently working on a non-mobile project) but from what I read it should be a huge improvement over the old emulator. I believe that you don’t need the IDE in order to run it, but better refer to the docs - Android Emulator 2.0. Here’s also a nice article which might help you get it running.


#9

I just tried the new version of the emulator. No need to install the IDE.

What I discovered, and did not remember that I had that before, is that error when doing “ionic run android”

I see my app behind that error, but when clicking on OK, it closes it.


#10

For the information, I just added this line into my config.xml


#11

It seems that it’s a common error when using an emulator and the explanation is:

The core reason: the problem is likely due to the speed of the emulator so the network is too slow complete the communication in a timely fashion.

To fix it you could add the following setting in your config.xml (as per this SO answer):

<preference name="LoadUrlTimeoutValue" value="70000"/>

Here’s the description of this setting from the Cordova docs:

When loading a page, the amount of time to wait before throwing a timeout error.
Default: 20000, 20 seconds


#12

oops! I forgot to add in my post the line that you gave me! :wink:

thanks


#13

I also had the similar issue when I first started the hybrid app development, In android version: You can use the setIntegerProperty method and pass in the ** loadUrlTimeoutValue** and the timeout_value Something like this:
super.setIntegerProperty("loadUrlTimeoutValue", 70000); This adds a timeout to call the index.html.

This error occurs when: 1.When you are the application on an emulator and the emulator is too slow, or 2. When the network connections are too slow.

Alternatively add the following line in the config.xml file:

<preference name="loadUrlTimeoutValue" value="700000" />