android - 在 Headless 模式下运行 Genymotion 2.8

标签 android genymotion

我正在尝试从命令行运行 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/

相关文章:

android - 如何通过wifi自动adb连接到设备

android - Genymotion 卡在黑屏

android - 如何在 Android 上将图像复制到 clipboardManager,例如?

java - ListView 未显示在 Fragment 中

Android 自定义对话框图标

android - 使用 houdini(Android 模拟器)在基于 x86 的 AVD 上运行 ARM 库

java - 无法使用 Genymotion 运行我的应用程序

java - Android studio 始终使用 JDK 7,不要切换到 JDK 8

java - 如何从 ReactApplication 中的 ReactNativeHost 中获取 MainActivity (ReactActivity)

android - 从 appium 命令识别 genymotion 模拟器的问题