我正在尝试从命令行运行 Genymotion 2.8 模拟器而不显示任何 UI。
我正在执行以下指令:
VBoxManage guestproperty set <vm-name> hardware_opengl 0
VBoxManage startvm <vm-name> --type headless
VM 启动,我可以使用 adb
连接到它,但随后我收到一堆错误,如下所示:
E/EGL_emulation: Failed to establish connection with the host
W/libEGL: eglInitialize(0xf708e040) failed (EGL_SUCCESS)
E/gralloc_vbox86: gralloc: Failed to get host connection
E/SurfaceFlinger: hwcomposer module not found
E/SurfaceFlinger: ERROR: failed to open framebuffer (I/O error), aborting
我能够在以前的 Genymotion 版本上使用它。
如有任何帮助,我们将不胜感激。
最佳答案
长话短说
Genymotion 虚拟设备不支持headless 模式。它不能简单地从 vbox 启动。
这是来自 this previous answer 的解释:
When you start a Genymotion device on the standard way from Genymotion Soft, the Android OS is starting inside a VirtualBox VM but all the UI processing (which uses OpenGL) is done outside the VM to make the rendering pipeline uses your computer's GPU. Using this hardware acceleration makes the Genymotion devices fairly smooth and fast.
When you start the Genymotion VMs directly from VirtualBox, the OS will start but the rendering won't be hardware accelerated. From 2.3 to 4.2 there is a fallback solution: the rendering will be computed by the CPU, from inside the VM. From 4.3, the soft rendering is not a good solution as it will slow down the OS too much to be acceptable, that's the reason why we've disabled it and it cannot be enabled.
关于android - 在 Headless 模式下运行 Genymotion 2.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39445545/