Skip to content

Instantly share code, notes, and snippets.

@anhhtz
Last active June 4, 2019 06:23
Show Gist options
  • Save anhhtz/414d04ac38a1410d5501365833feab6a to your computer and use it in GitHub Desktop.
Save anhhtz/414d04ac38a1410d5501365833feab6a to your computer and use it in GitHub Desktop.
Fixes bluetooth "freeze" after wake up from sleeping

Fixes bluetooth "freeze" after wake up from sleeping

How to use

Setup

  • Save/clone the script rs_bluetooth.sh. Example at /Users/davidbob/rs_bluetooth.sh. davidbob is your username.
  • Open Terminal app. Type command:

(sudo) chmod +x /Users/davidbob/rs_bluethooth.sh or (sudo) chmod +x ~/davidbob/rs_bluethooth.sh

  • Press Enter.
  • Done !

Use:

  • Open Terminal app.
  • Type ./rs_bluetooth.sh.
  • Enter your account password.
  • Press ENTER
  • Done !
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo launchctl stop com.apple.bluetoothd
sudo launchctl stop com.apple.diagnosticextensions.osx.bluetooth.helper
sudo launchctl stop com.apple.bluetoothReporter
sudo launchctl stop com.apple.IOBluetoothUSBDFU
sudo launchctl stop com.apple.bluetoothaudiod
sudo kextunload -v 6 -b com.apple.iokit.IOBluetoothFamily
sudo kextunload -v 6 -b com.apple.iokit.IOBluetoothHostControllerTransport
sudo kextunload -v 6 -b com.apple.iokit.IOBluetoothHostControllerUSBTransport
sudo kextunload -v 6 -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo /etc/init.d/bluetooth restart
sudo launchctl start com.apple.blued
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment