Skip to content

Instantly share code, notes, and snippets.

@hartsock
Created January 25, 2012 15:55
Show Gist options
  • Save hartsock/1676912 to your computer and use it in GitHub Desktop.
Save hartsock/1676912 to your computer and use it in GitHub Desktop.
for MacBook Pro with Bluetooth sound issues...
#!/bin/sh
# My MacBook Pro's bluetooth transmitter will sometimes get into an error state where it will not
# connect to my bluetooth headset without a reboot. This seems to happen when I walk out of range
# with the device on.
#
# This script stops and starts the bluetooth daemon itself effectively restarting the bluetooth
# services. NOTE: bluetooth must be turned off in the UI when you do this. It's clumsy but it
# beats rebooting.
# Note: edited to add a kick to the audio daemon that often gets confused if switching between sources.
# kill the daemons
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist
# give the "chips" a chance to "cool"
sleep 3
# restart the daemons
sudo launchctl load /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist
@hartsock
Copy link
Author

Okay, so I've noticed the sound daemon gets befuddled if you swap around multiple bluetooth devices for audio. So this kicker reboots both the bluetooth and audio daemons in OS X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment