I'm developing a Bluetooth LE device and am having trouble because of MacOS's caching of the services. If I try to delete a service or change its UUID on the device I'm developing, the change doesn't show up on the Mac and instead I continue seeing the old list of services and UUIDs from the device. I tried going to another Mac that hadn't paired with my device and it saw the new list of services with the correct UUIDs, so it seems to be a caching issue with my development Mac.
I found the com.apple.Bluetooth.plist file in /Library/Preferences and deleted it, but the system put it back with the same data, I presume the system has the cache loaded into memory and is just writing it back out when needed.
Does anybody know how to wipe the MacOS CoreBluetooth device/service cache?
Step 1: Open Settings and go to 'Apps'. Step 2: Next, go to the Bluetooth option and select it. Step 3: Tap on 'Storage' and 'Clear Cache'.
I finally found the source of the problem -- there's a cache in the user preferences folder in a folder named ByHost. Here are the steps to clear the Bluetooth cache:
After doing that my peripheral's services are correctly identified. From what I found on the web, there may also be some other com.apple.Bluetooth files in /Library/Preferences related to HIDs or headsets or something -- I don't know if it's important to delete those as I didn't have them on my system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With