Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change emulated performance of AVD in Android Studio

People also ask

How do you make AVD faster?

Go to the Android SDK root folder and navigate to extras\intel\Hardware_Accelerated_Execution_Manager. Execute file IntelHaxm.exe to install. (in Android Studio you can navigate to: Settings -> Android SDK -> SDK Tools -> Intel x86 Emulator Accelerator (HAXM installer)) Create AVD with "Intel atom x86" CPU/ABI.

Why is AVD emulator so slow?

The Android Emulator is very slow. The main reason is because it is emulating the ARM CPU & GPU, unlike the iOS Simulator, which runs x86 code instead of the ARM code that runs on the actual hardware.


Actually, this problem seems to be limited to devices with Play Store available, so Nexus 5X and Nexus 5 images will be forced to use Automatic Graphics, but all other devices allow you to choose either Automatic, Hardware or Software graphics.


edit: I've just tested this today and it seems to no longer be the case. At least on MacOS with Android Studio 3.3.2, I can now make a Nexus 5X image with Play Store and Hardware Graphics. I'll do more testing at home later, on Windows and Linux to see if it's related to OS or graphics drivers. AVD screen showing a Nexus 5X device with hardware graphics


I also think it's related to whether the Playstore is contained or not, but I cannot explain why.

Dielson Sales already gave the answer which worked for me - unfortunately only in a comment to this answer. I just thought it's worth to make a "real" answer out of it:

Edit the config.ini file of the AVD. Under Linux it's located under /home/<user>/.android/avd/<AVD-name>/config.ini (in my case <AVD-name> is Nexus_5X_API_29.avd).

In a text editor change the lines

hw.gpu.enabled=no
hw.gpu.mode=auto

either to

hw.gpu.enabled=no
hw.gpu.mode=off

or to

hw.gpu.enabled=yes
hw.gpu.mode=host

This setting remains even if opened in the Android Virtual Device Manager of Android Studio. It's just not editable there.

I also tried this, which I found in another AVD:

hw.gpu.enabled=yes
hw.gpu.mode=software

But this is then changed to "no" / "off" by the Android Virtual Device Manager. I didn't look any further so far. hw.gpu.mode=off worked for me. Otherwise my whole Kubuntu hangs (using the Nouveau driver, not the NVidia driver)


Seems like the problem was with the choosen VM. If I choose a Nexus 4, it runs just fine.


I am little late on this thread but following are my findings and solution. I am using Ubunut 18.04 and faced the same issue. The solution is to edit AVD and under Emulated Performance, change the grpahics to Software. The problem was that this option was disabled for me. I was unable to change graphics drop down.

I did some more research and found that while creating AVD if you choose default/existing device definition on first screen, you will not be able to edit graphics drop down.

The solution is to create a "New Hardward Profile" while creating AVD and use your new profile. Now, you will be able to edit "Grahics" drop down.

Hope this helps....