CoreBluetooth stopped working in my app

Hello,

I am the developer of an app that is published on the App Store. This app connects to Bluetooth devices to read their battery levels. However, it seems that CoreBluetooth, which is used to discover and connect to devices, has completely stopped working on macOS Monterey.

The delegate methods are no longer triggered. When I start my app I see the following messages in the output area:

[CoreBluetooth] No name or address

The Console app shows a lot of this messages:

error 14:56:23.730415+0200 bluetoothd Server.Core sdp attributes is empty

I don't know if this is related in any case. Are there any new entitlements or something like that? I did not change any single line and on Big Sur, everything works fine. A customer of mine, which also uses the beta version, already contacted me, so this seems to be a general issue - at least with my app? The app also works fine on Big Sur for the customer.

I created a new app that creates a new CBCentralManager instance and sets the delegate. The delegate functions are called properly, so this issue seems to be related to my app specifically. Other BLE scanner apps also seem to work fine. I tried deleting some Bluetooth Caches, but that did not solve the problem.

When using the same basic code from the example app in my production app, no delegate functions are called. Very weird. Monterey will be released tomorrow, so I am quite under pressure here 😢

The scanning process starts after the state has changed to poweredOn.

I then get this error:

Invalidating assertion 236-151-4668 (target:[app<application.appid.125946431.126032515.61252494-CF92-4555-8108-9155B47AA89C(501)>:1869]) from originator [daemon<com.apple.WindowServer(88)>:151]

Closed XPC connection to session "appid-central-1869-41"

Unregistering session "appid-central-1869-41"

This pretty much appears as soon as I start the app. Bluetooth entitlement is set in the entitlements file.

Every single Bluetooth device works fine on my iMac and yet I think that there is something really wrong regarding Bluetooth.

Because of all this trouble I completely reinstalled macOS Monterey (I even wiped the hard drive). After reinstalling macOS Monterey, I encountered the exact same behaviour.

I have read online, that you can (in theory) reset your Bluetooth adapter by pressing Command and Shift (or only Command) and the clicking the Bluetooth menu in the menu bar. There is additional information, but no option to reset the Bluetooth adapter.

Another problem is that there is no com.apple.bluetooth.plist file in the Preferences folder.

I really don't understand this at all.

Hi,

I have the same problem with our BT devices.

https://developer.apple.com/forums/thread/694146?login=true&r_s_legacy=true

We're facing the same issues with our commercial application -- something is wrong with CoreBluetooth since the latest update. We are also submitting tickets for this on our side.

CoreBluetooth stopped working in my app
 
 
Q