gpt4 book ai didi

android - 使用 -noaudio 选项运行 Android 模拟器返回 "qemu-system-i386.exe: -audio: invalid option"

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:01:09 25 4
gpt4 key购买 nike

  1. 我运行的是 Windows 10 64 位 Android Studio 2.2.2。从 Android SDK 的 AVD 管理器创建 AVD 时,我没有看到完全禁用音频(输入和输出)的选项。我正在使用具有 Android Tools 25.2.2 版本的 Android SDK。在旧的 AVD 管理器中,我记得存在完全禁用 AVD 音频的选项。
  2. 当我想创建批处理脚本时,使用 -noaudio 选项运行,如 Google 官方 Control the Emulator from the Command Line 中所述页面,我运行的命令为 emulator.exe -avd Nexus_4 -noaudio,但它抛出错误

qemu-system-i386.exe: -audio: invalid option

  1. Android 模拟器对话框打开,进度条不确定,AVD 根本没有启动。永远保持加载。

感谢任何帮助。

最佳答案

我已经在 Linux 上测试过了。 (对于 windows checkout 评论或@Tekk 回答)
如果您不想要音频,只需使用:

export QEMU_AUDIO_DRV=none && emulator -avd Nexus_4

长话短说

Quote from here

Based on some digging around, it looks like QEMU2 removed the ability to completely disabled audio - you can specify which sound card the audio goes through, but can't turn it off altogether. The "-audio" flag was replaced with "-soundhw", which lets us specify which sound card to use.

QEMU1 (using the "-engine classic" emulator command line flag) does work when "-noaudio" is passed), but passing "-soundhw none" to QEMU2 also fails.

解决方案:

Post about emulated audio devices

在 Linux 上,如果我想要声音,我使用:

export QEMU_AUDIO_DRV=pa && emulator.orig -avd Nexus_S_api_23

它工作正常。我也没有 100% 的 CPU 使用率

My snippet :

#!/bin/bash
# http://stackoverflow.com/a/35822173/1052261
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

#echo "DIR is '$DIR'"
#If you want audio pass QEMU_AUDIO_DRV=pa -> https://www.wagner.pp.ru/fossil/vws/wiki?name=QEMU+audio
export QEMU_AUDIO_DRV=none && $DIR/emulator.orig -use-system-libs "$@" -qemu -m 512 -enable-kvm

只需将 Android-sdk/tools/emulator 替换为 Android-sdk/tools/emulator.orig然后在 Android-sdk/tools/emulator 中使用上述源代码创建脚本(允许执行)。

请记住,有时当 android sdk 升级时,它会删除此脚本;)

关于android - 使用 -noaudio 选项运行 Android 模拟器返回 "qemu-system-i386.exe: -audio: invalid option",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40272884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com