Solve the Problem of starting emulator flashback in androidstudio on ubuntu (2), androidemulator crash
Platform
Ubuntu14.04 64
Symptom
After you click the start button of the simulator in AndrodStudio, the Simulator Interface pops up and immediately returns.
Solution 1: view the simulator Information
The following figure shows the path and name of the simulator:
Path:/home/pengdonglin/. android/avd/4_WVGA_Nexus_S_API_24.avd
Name: 4_WVGA_Nexus_S_API_24
Architecture: x86_64
2. Command Line running Simulator
Run the following command in the path of androidsdk:
./emulator/qemu/linux-x86_64/qemu-system-x86_64 -avd 4_WVGA_Nexus_S_API_24
The following error occurs:
emulator: WARNING: encryption is offWARNING: The Mesa software renderer is deprecated. Use Swiftshader (-gpu swiftshader) for software rendering.failed to create drawablegetGLES2ExtensionString: Could not create GLES 2.x Pbuffer!Failed to obtain GLES 2.x extensions string!Could not initialize emulated framebufferwarning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]emulator: emulator window was out of view and was recenteredemulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
There are two solutions from the prompt:
1. settings-gpu swiftshader
2. Set-gpu off
When running the simulator, adding any of the above can solve the problem, but in the end we do not run the simulator from the command line, so we have to write the above configuration to the startup configuration file of the simulator.
From the simulator configuration information:
You have already setSoftware GLES 2.0So here we need to modify the simulator configuration in the configuration file, the path of the configuration file:
~/.android/avd/4_WVGA_Nexus_S_API_24.avd/config.ini
The GPU configuration in this file is as follows:
hw.gps=yeshw.gpu.enabled=yeshw.gpu.mode=mesa
Solution 1:
hw.gpu.enabled=nohw.gpu.mode=mesa
Solution 2:
hw.gpu.enabled=yeshw.gpu.mode=swiftshader
Using any of the above, the simulator can run:
.