Winning the War Bluetooth on OS X

If you’re experiencing issues with MacID not reconnecting properly, this post outlines some of the things that you can do to try and overcome the problems.

Bluetooth in OS X is becoming the new wifi in OS X. That is to say, it’s now exceptionally buggy for some people.

While we wait for Apple to send out updates there are a few things we can do. There are a few files associated with Bluetooth on your Mac, don’t worry about breaking your Mac by deleting anything I recommend in this post because OS X will re-generate the files when it needs to.

In this post on Stack Overflow you can see there are two main files associated with the Bluetooth cache on your Mac. They’re located in two different places though so if this is your first time digging around in system folders you might get a little lost.

Here’s what to do:

There are two different Bluetooth files you need to find to clear the cache. Although I have already written a post on the first file, it uses Terminal, so here’s how to delete the file manually. Note that the file in the ByHost folder will have a few random characters in, but it will always start with 

First find these two folders:

  • /Library/Preferences can be found by opening Finder, clicking Go, then clicking on your hard drive, then choose Library, then choose Preferences.

    /Library/Preferences/ - file to delete
    /Library/Preferences/ – file to delete
  • ~/Library/Preferences/ByHost can be found by opening Finder, clicking Go while holding ALT on your keyboard, then clicking Library, then Preferences, then ByHost.

    ~/Library/Preferences/ByHost/ - file to delete
    ~/Library/Preferences/ByHost/ – file to delete
  1. Unpair your device from the MacID menu.
  2. Turn off Bluetooth.
  3. Delete from /Library/Preferences
  4. Delete files named from ~/Library/Preferences/ByHost (note that this is the user preference folder, not the system one)
  5. Restart BOTH your Mac and iPhone.
  6. Turn Bluetooth back on.
  7. Open both MacID for iOS and MacID for OS X to re-pair them.

What else can you do?

When I first started development on MacID I couldn’t get Bluetooth to turn off, the option was greyed out. Turns out there was a file lurking about that completely screwed everything up. After deleting a file in /Library/Preferences/SystemConfiguration called everything worked properly for me.

If that file exists on your machine, deleting it may help you here too.

You can also try my other post on clearing the cache using Terminal.

But why is this happening?

When MacID disconnects, either OS X or iOS (neither I nor Apple are sure which yet) is making the MacID app look like a new device by changing the identifier associated with it.

When you pair MacID for iOS with MacID for OS X, MacID for OS X stores the identifier and uses it to reconnect (so that it knows your iPhone is the right one). If that identifier changes, as above, then MacID will never be able to reconnect without re-pairing.

To make matters even more complicated, connection attempts never time-out with Bluetooth LE so it will forever sit at “waiting to attempt” assuming that your iPhone is just out of range.

During development this happened a few times, but always sorted itself out. Usually after clearing the cache as described above, and restarting both Mac and iPhone a couple of times.

I have now filed two separate bug reports with Apple and are sending them reports when I can.

Clear Bluetooth Cache for Core Bluetooth on Mac OS X

OS X really aggressively caches Bluetooth connections, which makes working with Core Bluetooth a royal pain.

After much searching about, I’ve found a way that seems to clear the cache properly. Turn off Bluetooth, open up terminal and copy and paste these three commands in order. You’ll have to enter your password after the first one, and you won’t see your password entered as you type (but it is being entered, so hit return once you’ve entered it and then copy the next two commands):

Once you’ve done that, you’ll need to restart. Voila, once you boot back up it should show you name changes on your iOS peripherals etc.

Can’t Turn *OFF* Bluetooth on Mac OS X – FIXED

Before continuing, remember the back up your data and I’m not responsible for any loss of data or damage to your computer.

[Jump to solution]

This was bugging me for quite some time, and although there are numerous posts on the web regarding this issue, nothing worked for me.

The problem I was having, was that Bluetooth was on, and couldn’t be turned off. In Bluetooth preferences in System Preferences the “Turn Bluetooth Off” button was greyed out and not selectable, and in the menu bar (sometimes called status bar), the option wasn’t there at all. Below are some screenshots of how it should look when everything’s working okay:

This is how it SHOULD look.
This is how it SHOULD look.
Turn Bluetooth Off didn't exist for such a long time :(
Turn Bluetooth Off didn’t exist for such a long time 🙁


This problem persisted through OS X 10.9 Mavericks to OS X 10.10 Yosemite, so at first I was concerned there was a problem with the Bluetooth radio in my computer.

As I say, there are plenty of posts on the web which come up when you search “can’t turn off bluetooth Mac“, and apparent fixes range from resetting the SMC, resetting PRAM, reinstalling kexts and changing .plist files, but nothing worked for me. I tried a lot of things.

So how did I fix it? Well, thankfully due to having OS X Yosemite on an external drive (for development testing while it was in beta) I could boot into that and see if Bluetooth worked properly there. Thankfully, it did, and that means that it’s not a problem with the Bluetooth radio in my Mac, rather a problem with my install. So I set about comparing all the Bluetooth related files hidden away I could find.

For some reason, on my faulty OS X install, in  /Library/Preferences/SystemConfiguration/ there was a file called In my working OS X install, this file didn’t exist. It was the only difference I could see, so I deleted it. After a restart, BEHOLD! The option to turn Bluetooth off re-appeared in both System Preferences and the menu bar.

Hopefully this helps others, as I found nothing to do with this on the web anywhere and there still seemed to be some people in forums that couldn’t fix theirs. Maybe this was the issue.