Home » Android » performance – Android Emulator laggy even with all optimizations

performance – Android Emulator laggy even with all optimizations

Posted by: admin June 15, 2020 Leave a comment

Questions:
  • HAXM Enabled version 7.1.0 and i verified that it’s working when the emulator is running
  • The emulator is using the Nvidia GPU however it’s barely using maximum 7% of the GPU at any given time
  • I have 27.3.1 of Emulator version ( Latest )
  • Tried x86 image and x86_x64 image
  • I tried hardware acceleration
  • I tried software acceleration
  • I bumped the emulator ram to 4GB (I have 20 GB)
  • I set the emulator CPU priority to real time
  • I have EVERYTHING but Android Studio and emulator running
  • The emulator is running horribly slow and laggy and even gives a black screen when going from activity to another
  • This has been the case since forever
  • I tried deleting the entire Android SDK and installing from scratch
  • I have intel virtual technology enabled in BIOS
  • I tried Google Apis vs none Google Apis emulators
  • I tried Nexus 5, X, Pixel 1, 2, XL with android P, O, 16 and all laggy
How to&Answers:

This is what helped me with my Android 9 emulator:

  1. Use Google Play x86 image instead of Google API x86 image, because the former had a notification “Preparing for setup..” which never finished.

  2. After launching the emulator first time, going through the initial google device setting (skipping what can be skipped..) and setting up the SD card (as an external storage).

  3. If there are some app updates running, wait for it and then force quit ‘Google play services’ app. If the emulator will be slow again after reboot, you might want to do this after every launch.

  4. Disable mobile data in settings, because it was trying to connect again and again, using up all CPU. And CPU helps with rendering, so if there is no available CPU, it gets slow.

Edit:

5. Go to emulator Settings/Advanced and set OpenGL ES rendered to Desktop native OpenGL and OpenGl ES API level to Renderer maximum and reboot the emulator. In my case, using autoselect/autodetect had far worse performance.

Answer:

— this is a follow up for my comment above (it’s too long to be written as a comment) —

then we established that the problem is coming from your compute (or your OS) – If you’re using a Laptop make sure to check the settings of the laptop performance when plugged and when you’re using a batterie. In case you have a desktop check also the settings if there is some sort of limitation set by the OS. That can happen to avoid overhitting and loud fan noises. If any of the above doesn’t work and you still really wanna figure this problem out and I’ll assume you’re using Windows 10, then install Ubuntu or any other Linux distribution as a second OS just to try things out. If The problem is solved then you definitely need to change some settings in your windows.

Answer:

For anyone looking for an answer. I simply updated windows 10 to a newer version and update my graphics card drivers and the emulator is insanely fast again.

Answer:

I had the same issue on my laptop and also on my high-end PC. I tried everything I could find on the internet:

Now, I cannot be 100 % sure that anything from above could not somehow contribute to fixing the issue (even that I changed most of it back), but the issue disappeared immediately after I did this:

  • Go to SDK Manager -> Install the latest SDK Platform

There is said in Android Developers User Guide [1] that these are the requirements for Graphics Acceleration:

  • SDK Tools: Latest release recommended (version 17 minimum)
  • SDK Platform: Latest release recommended (Android 4.0.3, Revision 3, minimum)

Even that I did have SDK Platform version 27, for some reason I believe that HW acceleration was not working, cause even moving the emulator windows was laggy (or even its settings). As I said before, latest SDK Platform version seems to be the thing that fixed it.

Also, do not forget to kill all emulator processes and also Android Studio. But maybe restart the whole computer just to be sure (I was doing it a lot, cause I was also checking a bios virtualization settings few times).

If it won’t work for you, try turn off the snapshots as that was the last before I tried this. You will have to wipe the data from that image, or even better – create a new AVD and download the latest image from “Recommended” tab.

Hope this will be helpful to someone as I did spend several frustrating hours fixing it (after few months of living with it).

Answer:

If your emulator is SUDDENLY slow, this might be the reason:
I ran through the same issue.
I then realized that it was a picture quality issue.
So if you’re using a lot of pictures in your app, it will run slow unless you ‘lower the picture quality’.
You can use http://compressimage.toolur.com/ to reduce your image quality.