Fix Bluetooth Audio Issues with Android Simulator on macOS

Alan Yang
Alan Yang
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


Manual Method

  1. Change directories into the avd folder for Android and open this directory in your editor (I used VS Code)
cd ~/.android/avd
code .
  1. There should be folders titled with the device and OS version. For each of these folders, modify the config.ini file.
  2. Change or add the following lines to the file:
  1. Open the Virtual Device Manager in Android Studio
  2. For each of the devices that where the config was edited, they will need to be reset
    • Wipe Data
    • Cold Boot Now

Bash Script Method

Alternatively, running this bash script that should try to do steps 1-4 from above.


# Find all config.ini files in the ~/.android/avd directory and its subdirectories
find ~/.android/avd -name "config.ini" | while read line
  # Remove any lines in the config.ini file that contain the string "" and save to a temporary file
  awk '!/' $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