Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Emulator laggy even with all optimizations

  • 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 NOTHING 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
like image 388
Roudi Avatar asked May 14 '18 12:05

Roudi


1 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.

like image 126
David Riha Avatar answered Oct 08 '22 08:10

David Riha