【发布时间】:2018-06-19 01:59:45
【问题描述】:
我有一个用于 CI 和测试的无头 Debian 服务器。我不知道发生了什么,但它坏了,所以我删除了整个 SDK 并从头开始。
我做到了:
-
检索最新的 URL:
curl -s 'https://developer.android.com/studio/index.html#downloads' \ | grep -oP 'https?://dl.google.com/android/repository/sdk-tools-linux[^" ]+' \ | sort | uniq - 下载并解压
-
更新了 SDK 管理器:
./tools/bin/sdkmanager --update -
接受许可:
yes | ./tools/bin/sdkmanager --licenses -
为 API 级别 27 安装了所有内容:
./tools/bin/sdkmanager --install "platforms;android-27" "system-images;android-27;google_apis;x86" - 我已经按照说明安装了KVM和Qemu
-
我创建了一个 AVD:
echo no | ./tools/bin/avdmanager create avd --force --name avdname -k "system-images;android-27;google_apis;x86" -
然后启动模拟器:
./emulator/emulator @avdname -no-window
它启动但在 logcat 中它抱怨缺少 Qemu:
01-09 23:15:19.278 4075 4075 D libEGL : Emulator has vendor provided software renderer, qemu.gles is set to 2.
01-09 23:15:19.282 4075 4075 D libEGL : loaded /vendor/lib/egl/libEGL_emulation.so
01-09 23:15:19.283 4075 4075 D libEGL : loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
01-09 23:15:19.288 4075 4075 D libEGL : loaded /vendor/lib/egl/libGLESv2_emulation.so
01-09 23:15:19.294 4075 4075 E : connect: failed with fd -1 errno 22
01-09 23:15:19.294 4075 4075 E : Failed to connect to host (QemuPipeStream)!!!
01-09 23:15:19.294 4075 4075 E EGL_emulation: Failed to establish connection with the host
01-09 23:15:19.294 4075 4075 W libEGL : eglInitialize(0xab2fb014) failed (EGL_SUCCESS)
01-09 23:15:19.295 4075 4075 I /system/bin/surfaceflinger: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
01-09 23:15:19.295 4075 4075 E EGL_emulation: tid 4075: eglGetConfigs(774): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.295 4075 4075 E EGL_emulation: tid 4075: eglChooseConfig(796): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.295 4075 4075 E EGL_emulation: tid 4075: eglGetConfigs(774): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.295 4075 4075 E EGL_emulation: tid 4075: eglChooseConfig(796): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.295 4075 4075 W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query
01-09 23:15:19.296 4075 4075 E EGL_emulation: tid 4075: eglGetConfigs(774): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.296 4075 4075 E EGL_emulation: tid 4075: eglChooseConfig(796): error 0x3001 (EGL_NOT_INITIALIZED)
01-09 23:15:19.296 4075 4075 F SurfaceFlinger: no suitable EGLConfig found, giving up
01-09 23:15:19.296 4075 4075 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 4075 (surfaceflinger), pid 4075 (surfaceflinger)
01-09 23:15:19.305 4086 4086 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
01-09 23:15:19.306 1592 1592 I /system/bin/tombstoned: received crash request for pid 4075
01-09 23:15:19.307 4086 4086 I crash_dump32: performing dump of process 4075 (target tid = 4075)
我有hw.gpu.enabled = false,不确定是否相关。
KVM 很高兴:
$ ./tools/emulator -accel-check
accel:
0
KVM (version 12) is installed and usable.
accel
我不知道是 KVM 是问题还是 GPU 加速是其他问题。
有趣的是,这就像一个魅力:
./tools/bin/sdkmanager --install "system-images;android-26;google_apis;x86_64" "platforms;android-26"
echo no | ./tools/bin/avdmanager create avd --force --name avd26 -k "system-images;android-26;google_apis;x86_64"
./emulator/emulator @avd26 -no-window
是因为它是 x86_64 图像吗?因为 API 27 系统映像有问题?为什么没有 API 27 b 的 64 位图像?
【问题讨论】:
标签: android android-emulator qemu kvm headless