steven young
steven young

Reputation: 1

Launch android emulator from avd makes emulator seriously slow

I've enable Intel HXAM.

Setting "Emulator performance" to Hardware - GLES 2.0

But if I launch it from avd, emulator's performance is really bad.

And If I launch it from command line with option "-gpu on", everything is correct now, emulator is fast and smooth.

Anyone has any idea about this problem? How could I launch emulator from avd with option "-gpu on"? Thanks!

Upvotes: 0

Views: 1674

Answers (1)

Ko Vartthan
Ko Vartthan

Reputation: 454

The reason is here and i referred from this link Click here

GPU emulation

GPU emulation (sometimes referred to as GPU acceleration) is where the emulator utilises the host machine’s GPU to accelerate drawing options. This can make the emulator run much faster.

GPU Emulation is turned off by default, so you need to enable it whenever you launch an AVD. Although ‘Use Host GPU’ used to appear in the AVD Manager, this option isn’t currently available in Android Studio, but the good news is you can still enable GPU emulation if you launch an AVD from the command line.

To launch your AVD with GPU emulation enabled, create the AVD you want to use as normal. In this example, I’m going to create an imaginatively-named myemulator AVD.

Open your Mac’s Terminal (or Command Prompt, if you’re a Windows user) and then ‘change directory’ so the Terminal is pointing at Android SDK’s ‘Tools’ folder. My command looks like this:

cd /Users/jessicathornsby/Library/Android/sdk/tools

Next, launch the emulator you created (myemulator) with the -gpu on flag, for example:

./emulator @myemulator -gpu on

The AVD will launch with graphics acceleration enabled. Spend some time interacting with the AVD, and you should notice a speed improvement.

Upvotes: 1

Related Questions