如何清除MacOS上的CoreBluetooth缓存? [英] How can I clear the CoreBluetooth cache on MacOS?

查看:626
本文介绍了如何清除MacOS上的CoreBluetooth缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Bluetooth LE设备,但由于MacOS的服务缓存而遇到麻烦.如果我尝试在正在开发的设备上删除服务或更改其UUID,则更改不会在Mac上显示,而是继续从该设备上看到服务和UUID的旧列表.我尝试转到另一台未与我的设备配对的Mac,它看到了具有正确UUID的新服务列表,因此这似乎是我的开发Mac的缓存问题.

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.

我在/Library/Preferences中找到了com.apple.Bluetooth.plist文件并将其删除,但是系统将其与相同的数据放回去,我假设系统已将缓存加载到内存中并且只是将其写回在需要时退出.

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.

有人知道如何擦除MacOS CoreBluetooth设备/服务缓存吗?

Does anybody know how to wipe the MacOS CoreBluetooth device/service cache?

推荐答案

我终于找到了问题的根源-在名为ByHost的文件夹中的用户首选项文件夹中有一个缓存.以下是清除蓝牙缓存的步骤:

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:

  • 关闭蓝牙
  • 从以下位置删除com.apple.Bluetooth.plist /图书馆/首选项
  • 删除名为 com.apple.Bluetooth.somehexuuidstuff.plist来自 〜/Library/Preferences/ByHost(请注意,这是用户偏好设置 文件夹,而不是系统文件夹)
  • 打开蓝牙
  • Turn off Bluetooth
  • Delete com.apple.Bluetooth.plist from /Library/Preferences
  • Delete files named com.apple.Bluetooth.somehexuuidstuff.plist from ~/Library/Preferences/ByHost (note that this is the user preference folder, not the system one)
  • Turn on Bluetooth

这样做之后,可以正确识别我的外围设备的服务.根据我在网上发现的信息,/Library/Preferences中可能还存在其他与HID或耳机相关的com.apple.Bluetooth文件或其他内容-我不知道删除这些文件是否很重要,因为我没有将它们安装在我的系统上.

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.

这篇关于如何清除MacOS上的CoreBluetooth缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆