Skip to content

DevFlow.Agent crashes macOS apps on startup - missing NSBluetoothAlwaysUsageDescription #253

@jfversluis

Description

@jfversluis

Description

The Microsoft.Maui.DevFlow.Agent package (v0.1.0-preview.7.26230.1) crashes macOS apps on startup with a TCC privacy violation because it uses CoreBluetooth (CBCentralManager) for BLE device discovery without requiring the host app to declare NSBluetoothAlwaysUsageDescription in its Info.plist.

Steps to Reproduce

  1. Create a .NET MAUI macOS app (net10.0-macos)
  2. Add Microsoft.Maui.DevFlow.Agent v0.1.0-preview.7.26230.1 (Debug only)
  3. Build and run in Debug
  4. App crashes immediately on startup

Crash Log

[com.apple.TCC:access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

Root Cause

The DevFlow agent added CoreBluetooth-based device discovery in preview.7. Decompiling the assembly shows:

private CBCentralManager? _centralManager;
_centralManager = new CBCentralManager(_delegate, null);

The older preview.4 (v0.1.0-preview.4.26202.3) does NOT have this code and works fine without the Info.plist key.

Workaround

Add an Info.plist to the macOS project with:

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Required for DevFlow device discovery.</string>

Suggested Fix

The DevFlow agent should either:

  1. Weak-link CoreBluetooth and gate usage behind an availability/permission check so the app does not crash if the key is missing
  2. Document the Info.plist requirement clearly
  3. Or defer Bluetooth initialization until explicitly requested rather than at startup

/cc @aritchie

Environment

  • .NET SDK: 10.0.102
  • macOS workload: 26.2.10217
  • Target: net10.0-macos
  • Package: Microsoft.Maui.DevFlow.Agent 0.1.0-preview.7.26230.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevFlowIssues or PRs that have to do with DevFlowbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions