Fix Bluetooth Audio Issues with Android Simulator on macOS
October 30, 2022 - 2 min read
There is an issue with Android Simulator where sometimes when Bluetooth audio is being used, the current audio will completely stop working when starting an emulated Android device. To fix this issue, we have to modify the config files for each of the Android devices.
Table of Contents
- Change directories into the
avdfolder for Android and open this directory in your editor (I used VS Code)
cd ~/.android/avd code .
- There should be folders titled with the device and OS version. For each of these folders, modify the
- Change or add the following lines to the file:
hw.audioInput = no hw.audioOutput = no
- Open the
Virtual Device Managerin Android Studio
- For each of the devices that where the config was edited, they will need to be reset
Cold Boot Now
Bash Script Method
Alternatively, running this bash script that should try to do steps 1-4 from above.
#!/bin/bash # Find all config.ini files in the ~/.android/avd directory and its subdirectories find ~/.android/avd -name "config.ini" | while read line do # Remove any lines in the config.ini file that contain the string "hw.audio" and save to a temporary file awk '!/hw.audio/' $line > tmp # Remove the original config.ini file rm $line # Rename the temporary file to config.ini mv tmp $line # Add the hw.audioInput and hw.audioOutput properties and set them to "no" echo "hw.audioInput = no" >> $line echo "hw.audioOutput = no" >> $line done