MacOS – How to restart Bluetooth service from command line

bluetoothdaemonsmacos

On Linux, if one wishes to restart the Bluetooth service, they simply launch a terminal and issue the following command:

sudo /etc/init.d/bluetooth restart

What is the equivalent on Mac OS X? I would like to restart my Bluetooth without having to restart the entire computer.

I am using Yosemite.

Update: Of the various command line options provided by Testing below the only one that seemed to work was the last, which is this:

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

Update 2: The above command no longer works and I wonder if it ever did. The first time I tried it it might have been something else that restarted my bluetooth services. The only thing that will work for me is a restart of the entire machine every morning.

Best Answer

On High Sierra, none of the command line options worked for me. I was able to plug in a wired USB mouse and use the Shift + Option with Debug/Rest solution.

I tried the blueutil solution on my High Sierra, and it worked like a charm. I regularly have Bluetooth on my 2015 MBPR with an Apple Magic Mouse hose up, and have to restart. Yeah, I could open the lid and use the track pad, but it's on the other side of the wall from my desk space.

You can install blueutil using Homebrew:

brew install blueutil

Or you can compile and install it by hand using:

cd ~/tmp/
git clone https://github.com/toy/blueutil.git
cd blueutil
make
make test 
cp blueutil ~/bin/

Now run:

blueutil -p 0 && sleep 1 && blueutil -p 1