Force Android emulator to use GPU hardware acceleration
See original GitHub issueOn my machine emulator seems to be running without GPU acceleration when launched from Visual Studio Code
or AVD
event when I configure hardware acceleration as follows:
But I when I launch it from command line with -gpu host
argument rendering performance increases dramatically.
Android documentation at https://developer.android.com/studio/run/emulator-acceleration says:
By default, the emulator decides whether to use hardware or software graphics acceleration based on your computer setup. If your GPU hardware and drivers are compatible, the emulator uses the GPU. Otherwise, the emulator uses software acceleration (using your computer’s CPU) to simulate GPU processing.
If you start the emulator from the command line, you can also override the graphics acceleration setting in the AVD for that virtual device instance.
I am not sure if this is some issue with Android emulators / AVD on my machine or it is something that could help other users too and might be implemented in Dart Code
?..
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (5 by maintainers)
Top GitHub Comments
Actually, I tried setting
Graphics
dropdown to bothAutomatic
andHardware - GLES 2.0
and launching emulator fromAVD Manager
Still my observations are that rendering is better/smoother if I launch emulator using command line using console command
C:\Users\<my username>\AppData\Local\Android\Sdk\emulator\emulator.exe -avd MyAvd -gpu host
Anyways, this issue (if it exists) is 100% not connected to
Dart-Code
, it might be related to Android tooling or even my machine configuration.That’s why I decided to close the issue:) @DanTup, thank you very much for all your help!
I dont know if you already fix this issue, but the work oround I used is: 1.I changed the name from emulator to emulator-bin 2. And created a bash script with $EMULATOR_PATH/emulator $*
this fixed my problem