简体   繁体   中英

Android Emulator very slow on Ubuntu 20.04

My Android emulator runs very slow on my Ubuntu machine. I need it to run faster, because some apps are slowed down so much, that they change their behaviour (they use the camera).

System specs:

-x86_64
-Intel(R) Core(TM) i7-5600U CPU @ 2.60 GHz
-20GB Ram
-512Gb HDD

I use Ubuntu 20.04 and Android Studio 4.1.1 (fresh installation). I use this AVD: Pixel2 1080 x 1920: 420dpi API 28 Android 9.0 (Google X86_ARM) CPU/ABI: x86 In the extended menu I chose Graphics: Hardware - GLES 2.0 . I also disabled GPS, audioInput and audioOutput with no performance improvements. I did not try this , because selecting Hardware - GLES 2.0 worked for me and the avd started normally (but still very slow).

Other system images are equally slow though.

I tried:

sudo modprobe msr
sudo rdmsr 0x3A

and it returns 5 , so VT-X is enabled

Is the hardware the bottleneck, or is something configured wrongly? Maybe it is the HDD that slows the emulator down? I tried running the emulator on Windows and it's insanely fast. The windows machine is stronger though.

Update 11.12.2020: I also verified my KVM installation using this command:

./emulator -avd Pixel2Api28Arm -accel-check

It returned this:

28Arm -accel-check
accel:
0
KVM (version 12) is installed and usable
accel

So this does not seem to be an issue.

I was having the same problem (KVM working, but slow x64 emulator on x64 host), and found a solution here , which is to disable automatic snapshot creation.

Run your emulator, and click on the three dots (...) to open the settings:

In the settings, click "Snapshots":

Switch to the "Settings" section on top:

Set "Auto-save current state to Quickboot" to No:

It'll ask you to restart the emulator, click Yes:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM