The goal of the script is to fix common Bluetooth issue when running Android Emulator on macOS. Script modifies emulator configs in batch, so you don't have to do it manually, one by one.
There're a few options to get and run the script.
- git clone
git clone git@github.com:mrmike/fix-android-emulator-audio.git
# and call ./fix-android-emulator-audio inside repo directory
- Homebrew
brew tap mrmike/homebrew-fix-android-emulator-audio
brew install fix-android-emulator-audio
# and call fix-android-emulator-audio from any location
- curl - you can use curl to get and run the script
curl -s https://raw.githubusercontent.com/mrmike/fix-android-emulator-audio/main/fix-android-emulator-audio | bash /dev/stdin
Before calling the script make sure that emulator is closed.
fix-android-emulator-audio
# Sample output
π Processing emulators from: /Users/<USERNAME>/.android/avd
π Processing - Pixel_5_API_31.avd
β
Done - Pixel_5_API_31.avd
π Processing - 4.7_WXGA_API_27.avd
β
Done - 4.7_WXGA_API_27.avd
By default script will look on emulators located at ~/.android/avd
. Script accepts argument with custom avd
directory localization
fix-android-emulator-audio path/to/your/avd/directory
Optionally you can pass --wipe
option to wipe emulator's data so you don't have to do it manually via Android Studio. Script removes following files and directories:
* snapshots/
* userdata.img
* userdata-qemu.img
When running emulator for the first time after applying the fix make sure that data is wiped and emulator is started with Cold Boot option.
Script modifiy emulator config and disable audio input and output by specyfing
hw.audioInput=no
hw.audioOutput=no
- Credits goes to Matt McKenna (himattm) for publishing article Android Emulators vs Bluetooth Headphones
All pull requests are welcomed. You can contact me on Twitter at @moczul