17

Any way to do this either via a utility, command-line, or otherwise? I regularly have my headphones and moused paired which causes the Bluetooth service to crash nearly daily. Sometimes I can just repair the devices but other times the service breaks completely. When that happens I have to reboot; very annoying indeed.

Is there a "Factory Reset" option for Apple Bluetooth keyboard, mouse, trackpad?

bmike
  • 235,889
xanadont
  • 626

4 Answers4

20

Either High Sierra or Mojave was the last OS to have the native options below. They are no longer viable on Catalina and up AFAIK. I (or someone) will edit in fixes for the latest macOS once we have tested / identified them. Seek support from Apple in the mean time.


I 2011 I there was not an easy fix (you had to download, install, and use developer tools), but soon thereafter on OS X, advanced features were provided from the Bluetooth icon in the menu bar. Hold shift and option (only) when clicking on the icon:

enter image description here

The debug menu has most of the action oriented items you'll need:

enter image description here

I've never seen resetting the module work better than powering it off, but I'm sure theres cases where this speeds troubleshooting and might save a trip to the repair shop if software corruption / settings drift is the cause of issues.

Logging is useful, but the logs are very very large, so keep that in mind and set a reminder to turn it off tomorrow.

On older OS, you needed a developer tool to systematically remove pairing records and HID devices. Bluetooth Explorer ships with Xcode 3. (as of today, early June 2011 - this is something available at no cost if you agree to the terms of the free developer program. It might also be bundled with Xcode 4 - available with paid download or paid mac developer program - but I can't vouch for that) You can also browse the developer documentation for free to learn more about bluetooth implementation.

The explorer has a detailed window with many settings to automate resetting devices for testing. Here is a portion of the window showing that not only are the local mac settings cleared, it will reach out to Apple Bluetooth devices and reset their internal state as well.

Bluetooth Explorer - reset options

Since bluetooth has to start very soon in the boot process (and is part of the setup assistant since new macs that have no accounts have to know how to set up Bluetooth keyboards and mouse out of the box) it's not just a simple user preference file but instead a system level preference and stored in several locations.

You will be able to make your mac factory fresh to test bluetooth with the Bluetooth Explorer.

bmike
  • 235,889
  • 1
    Shame you have to go through developer tools to do this noise. – xanadont Jun 09 '11 at 00:14
  • Most people don't have issues and never need these tools. Good luck and I hope the underlying problem gets resolved. Automating the reset process is a poor workaround for something that should just work. I can imagine your frustration at having to do this even once a month. – bmike Jun 09 '11 at 16:49
  • 2
    In Xcode 4 they have removed BT Explorer and it's now a download on the developer site as part of "Hardware IO Tools". Also your answer fixed my screwed up BT! Cheers JR – Jon Rhoades Sep 21 '12 at 02:27
  • Unfortunately, I'm currently finding that the version included in "Hardware IO Tools for Xcode - October 2013" crashes on launch on 10.8.5 despite that edition of the tools supporting Mountain Lion and later. – Joe Carroll Apr 28 '14 at 07:20
  • 1
    Would like to note two things: first of all, in version 4.3.0 of this software (the most recent version), the way to find this menu is Tools -> Modify Software & Device Configuration, or Cmd-Shift-U. Secondly, if your problem, like mine, is that your paired devices are refusing to connect, this will not do anything to help you, since your devices aren't connected. Upon restart my devices connected, which is good, but that was only because I restarted my computer. The devices should have been forgotten, but weren't, because this only works on connected devices. – 2rs2ts May 29 '15 at 18:54
  • @xanadont Apple heard your plea and moved these tools into the core OS. – bmike Oct 30 '15 at 14:42
  • @JoeCarroll It's now in the core OS :-) – bmike Oct 30 '15 at 14:43
  • FYI for others. I had the issue of bluetooth headphones skipping after the computer was sleeping overnight which I previously had to reboot the computer to fix. I'm using OS X 10.11.3. The Reset the Bluetooth module debug menu command fixed this for me, so thanks! Much more convenient. – ghoppe Feb 05 '16 at 15:20
  • Noting here that with High Sierra, the command-option-click on bluetooth allows you to remove individual devices. – Traveler Aug 26 '20 at 16:57
  • This menu seems to be gone in Ventura, replaced by a simpler interface. – Tetsujin May 01 '23 at 07:59
7

There's a command-line tool for the bluetooth service called blueutil — you could try if it can help you.

Alternatively, you could reload blued:

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

This should first kill the service if it's still on and the second enables it again.
I don't know if this fixes your problem, since I don't have BT service dying on me to test it :)

grg
  • 201,078
deiga
  • 1,274
  • 1
  • 10
  • 21
  • 1
    Thanks. Just tried it. Unfortunately this only allows you to turn the service on and off as you can do from the menu. But once the service is broken then toggling on/off does nothing to fix it. I need a reset option. – xanadont Feb 22 '11 at 20:04
  • 1
    This just reboots the daemon and doesn't reset the files. – bmike Jun 04 '11 at 15:07
7

This (and only this) worked for me besides restarting my machine.

From Restart Bluetooth Daemon on Mac OS X without restarting

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
user3439894
  • 58,676
  • 4
    Years later and none of the suggestions herein have ever helped. Was glad to see this suggestion in a SE notification in my inbox. A day later (today) I needed it. And now this doesn't work for me either: Can't unload kext com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport; classes have instances: (kernel) Kext com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport class BroadcomBluetoothHostControllerUSBTransport has 1 instance. Failed to unload com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport - (libkern/kext) kext is in use or retained (cannot unload). – xanadont Mar 25 '16 at 17:12
  • @xanadont have you found any working solution? – void Nov 12 '18 at 06:23
  • @VladE.Borovtsov Never found anything 100% reliable. Fortunately with newer hardware I don't ever run into this anymore. – xanadont Nov 12 '18 at 16:04
  • @xanadont i thought problem will be eliminated on new MacBook. But it's still happening. Especially when i connect discharged iPhone or iPad to USB. the only way for me to fix bt issue temporary - just reboot :( – void Nov 13 '18 at 07:50
4

Go to the Activity Monitor, and under process names there should be one called "blued", click it, then "Quit Process", Force Quit, then the bluetooth service should have restarted on its own.

Carlos
  • 41
  • This could be exactly what I was looking for. I've since gotten a new machine since this issue and haven't had problems since. But if I do, I'll try to keep this tip in mind. – xanadont Jul 17 '12 at 16:13
  • 1
    You need to use View -> All Processes to see this daemon. In my experience killing it doesn't address my problem, but my problem might be different from xanadont's. – ThomasW Feb 05 '15 at 06:42
  • No other solution worked for me. This worked for me - I just force quit all "bluet**" services in activity monitor. Thank you! – sP_ May 15 '20 at 17:35