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 com.apple.Bluetooth 

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/com.apple.Bluetooth.plist - file to delete
    /Library/Preferences/com.apple.Bluetooth.plist – 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/com.apple.Bluetooth.randomcharacters.plist - file to delete
    ~/Library/Preferences/ByHost/com.apple.Bluetooth.randomcharacters.plist – file to delete
  1. Unpair your device from the MacID menu.
  2. Turn off Bluetooth.
  3. Delete com.apple.Bluetooth.plist from /Library/Preferences
  4. Delete files named com.apple.Bluetooth.somerandomcharacters.plist 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 com.apple.Bluetooth 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.

Kane Cheshire

Author: Kane Cheshire

I’m a software developer (and sort of designer) from Hertfordshire.

I spend a lot of time learning, travelling and flying my drone.
I made MacID. You can check out some of my favourite photographs from travelling at http://kane.codes.

I’m also the creator and lover of Twicnic, an annual Twitter picnic event.

6 thoughts on “Winning the War Bluetooth on OS X”

  1. I followed your steps to clear the files under Library/Preferences (both locations), but I still had to unpair and run setup every time I went out of range. It would just fail to connect. I then came across the below posting that helped someone with their bluetooth speakers. So I followed that advice and then did you full procedure again with the reboots and now MacID has been working reliably for now. Hope this helps others…

    https://discussions.apple.com/thread/6808048

    As for your bluetooth issues, I would suggest trying this fix from Pete over at iHealthGeek.

    “Go into your Network Preferences for Yosemite, and delete any interfaces which are Bluetooth PAN, and problem solved.”

    If that doesn’t work one of the commentors noticed that there are (in some cases) bluetooth DUN connections that are invisible until they are added. It seems that there might be issues with wifi/bluetooth even if bluetooth dun isn’t active. The solution is to remove the connection entirely. See if that works by doing the following.

    “you need to go into Network Preferences, add one in, and then remove it again”

  2. Update since last comment in February. It is March 3rd and still no problems. The bluetooth continues to reconnect as expected.

  3. Thanks. This got me going on a nettlesome installation of MacID, detailed in a 5 star review on iTunes. Bluetooth LE seems either really difficult to implement or poorly conceived. Just my silly opinion.

    Gary K.

  4. Great post Kane. I found clearing the cache helped out back in MacID OS X 1.2 (4)
    I’ll be sure to take notice of the .plist for future updates if I have similar issues.
    Nice blog as well, and will be bookmarking it, as it has some interesting takes on things.
    Love MacID, and by far the best of the rest of this genre that is out there. That Knock 2.0 is a gimmick in MHO, because if someone stole your Mac and iPhone, then all they do is knock to get in. How bloody stupid is that. Thats not security. but this MacID is a extra layer, and love it.
    Thanks for such a awesome App mate.

  5. Back up again. Had deleted the ByHost plist and lockfile files, but I think the most helpful, relevant action was using the Option key to open Bluetooth from the top menu bar and clicking Remove for my iPhone (which had been listed twice; so removed both). Upon next restart of both Mac and iPhone I was able to reconfigure MacID and resume happy use of this tool

Leave a Reply

Your email address will not be published. Required fields are marked *