【问题标题】:Can't start emulator in headless mode无法在无头模式下启动模拟器
【发布时间】:2023-03-31 00:22:01
【问题描述】:

我试图用以下命令启动emulator

/home/shahrear/Android/Sdk/emulator/emulator -avd Pixel2_API_29 -no-window 

但我收到以下错误。如果没有 no-window 选项,它可以正常工作,但我需要以无头模式启动它。

pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
E1008 14:00:45.458379787   17283 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1602144045.458354128","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}

adb devices 显示离线

【问题讨论】:

标签: android android-emulator adb


【解决方案1】:

我使用以下 2 个命令解决了这个问题:

echo yes | /bin/Android/Sdk/tools/bin/sdkmanager --licenses
touch /home1/www/.android/repositories.cfg

参考:Stuck at ".android/repositories.cfg could not be loaded."

另外,您可以通过指定 -noaudio 来消除音频错误。

例如,

emulator @Nexus_5X_API_23 -noaudio

参考:https://developer.android.com/studio/run/emulator-commandline

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-16
    • 2020-06-08
    • 2014-12-20
    相关资源
    最近更新 更多