我在 android studio 之外使用模拟器 cli 工具。我已经使用
avdmanager
创建了我的 avd,现在正在尝试启动 avd。当我输入“emulator -avd my_android_30_avd”时,我得到以下输出,并且模拟器以我认为是genymotion的方式启动(但我可能是错的)。我想使用 Wayland 合成器启动模拟器。我相信由于以下消息而失败了
"Warning: Could not find the Qt platform plugin "wayland" in "/nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/lib64/qt/plugins"
有 android-sdk wwayland 插件吗?是否可以使用 wayland 启动我的模拟器?
INFO | Storing crashdata in: /tmp/android-billy/emu-crash-35.1.4.db, detection is enabled for process: 22525
INFO | Android emulator version 35.1.4.0 (build_id 11672324) (CL:N/A)
INFO | Found systemPath /nix/store/55nhl8lj7idnxappslddgzcykpgzr3wh-androidsdk/libexec/android-sdk/system-images/android-30/google_apis_playstore/x86_64/
INFO | Storing crashdata in: /tmp/android-billy/emu-crash-35.1.4.db, detection is enabled for process: 22525
INFO | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
WARNING | Please update the emulator to one that supports the feature(s): Vulkan
INFO | Increasing RAM size to 2048MB
WARNING | File System is not ext4, disable QuickbootFileBacked feature
WARNING | FeatureControl is requesting a non existing feature.
INFO | Warning: Could not find the Qt platform plugin "wayland" in "/nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/lib64/qt/plugins" ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_posture_requested(int) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_posture_selection_dialog() ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_new_resizable_requested(PresetEmulatorSizeType) ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_dismiss_resizable_dialog() ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_sleep_timer_done() ((null):0, (null))
INFO | Warning: QMetaObject::connectSlotsByName: No matching signal for on_unfold_timer_done() ((null):0, (null))
WARNING | Your GPU drivers may have a bug. Switching to software rendering.
library_mode swangle_indirect gpu mode swangle_indirect
INFO | Initializing hardware OpenGLES emulation support
android_startOpenglesRenderer: gpu infoI0907 11:31:09.553583 22525 HealthMonitor.cpp:279] HealthMonitor disabled.
cannot add library /nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
cannot add library /nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so.1: failed
added library /nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/lib64/vulkan/libvulkan.so
createGlobalVkEmulation:997 Selecting Vulkan device: SwiftShader Device (Subzero)
initialize: Supports id properties, got a vulkan device UUID
I0907 11:31:09.604375 22525 VkCommonOperations.cpp:1287] Initializing VkEmulation features:
I0907 11:31:09.604393 22525 VkCommonOperations.cpp:1288] glInteropSupported: false
I0907 11:31:09.604396 22525 VkCommonOperations.cpp:1289] useDeferredCommands: true
I0907 11:31:09.604399 22525 VkCommonOperations.cpp:1291] createResourceWithRequirements: true
I0907 11:31:09.604401 22525 VkCommonOperations.cpp:1292] useVulkanComposition: false
I0907 11:31:09.604403 22525 VkCommonOperations.cpp:1293] useVulkanNativeSwapchain: false
I0907 11:31:09.604405 22525 VkCommonOperations.cpp:1294] enable guestRenderDoc: false
I0907 11:31:09.604407 22525 VkCommonOperations.cpp:1295] ASTC LDR emulation mode: 2
I0907 11:31:09.604409 22525 VkCommonOperations.cpp:1296] enable ETC2 emulation: true
I0907 11:31:09.604412 22525 VkCommonOperations.cpp:1297] enable Ycbcr emulation: false
I0907 11:31:09.604414 22525 VkCommonOperations.cpp:1298] guestUsesAngle: false
I0907 11:31:09.604416 22525 VkCommonOperations.cpp:1299] useDedicatedAllocations: false
I0907 11:31:09.604593 22525 FrameBuffer.cpp:505] Graphics Adapter Vendor Google (Google Inc.)
I0907 11:31:09.604596 22525 FrameBuffer.cpp:506] Graphics Adapter Android Emulator OpenGL ES Translator (Google SwiftShader)
I0907 11:31:09.604598 22525 FrameBuffer.cpp:507] Graphics API Version OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)
I0907 11:31:09.604600 22525 FrameBuffer.cpp:508] Graphics API Extensions GL_OES_EGL_sync GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_standard_derivatives GL_OES_texture_npot GL_OES_rgb8_rgba8 GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888
I0907 11:31:09.604604 22525 FrameBuffer.cpp:509] Graphics Device Extensions N/A
WARNING: cannnot unmap ptr 0x7fff4d7ec000 as it is in the protected range from 0x7fff4d7ec000 to 0x7fffcd9ec000
WARNING: cannnot unmap ptr 0x7fffcd801000 as it is in the protected range from 0x7fff4d7ec000 to 0x7fffcd9ec000
INFO | Monitoring duration of emulator setup.
WARNING | The emulator now requires a signed jwt token for gRPC access! Use the -grpc flag if you really want an open unprotected grpc port
INFO | Using security allow list from: /nix/store/h43v0qqmis2difm7kmnxsbr5ijxadjik-android-sdk-emulator-35.1.4/libexec/android-sdk/emulator/lib/emulator_access.json
WARNING | *** Basic token auth should only be used by android-studio ***
INFO | The active JSON Web Key Sets can be found here: /run/user/1000/avd/running/22525/jwks/81641faa-bc69-4ff2-9918-112da4ba44ee/active.jwk
INFO | Scanning /run/user/1000/avd/running/22525/jwks/81641faa-bc69-4ff2-9918-112da4ba44ee for jwk keys.
INFO | Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token
INFO | Advertising in: /run/user/1000/avd/running/pid_22525.ini
I0907 11:31:09.678364 22575 FrameBuffer.cpp:2879] Setting display: 0 configuration to: 1080x1920, dpi: 420x420
I0907 11:31:09.678383 22575 FrameBuffer.cpp:2892] setDisplayActiveConfig 0
INFO | Loading snapshot 'default_boot'...
WARNING | Failed to process .ini file /home/billy/.android/emu-update-last-check.ini for reading.
WARNING | Device 'cache' does not have the requested snapshot 'default_boot'
WARNING | Failed to load snapshot 'default_boot'
WARNING | Failed to process .ini file /home/billy/.android/emu-update-last-check.ini for reading.
INFO | Boot completed in 19123 ms
INFO | Increasing screen off timeout, logcat buffer size to 2M.
我遇到了同样的问题,从终端启动是通过在启动模拟器之前设置 QT_QPA_PLATFORM=xcb 来解决的,以便模拟器从 android studio 正确启动,您需要更改 android studio 的 .desktop 文件,在我的情况下该文件位于/usr/share/applications/android-studio.desktop ,您需要将 exec 更改为此 Exec=env QT_QPA_PLATFORM=xcb android-studio %f