I'm trying to build an app that requires the user to select a preferred device, any bluetooth audio device will do.

I have this code that prompts the user for bluetooth devices but when the window shows up theres nothing in the list, even tough osx has no issues finding my devices.

private var selectedDevice: IOBluetoothDevice?

// Called when user presses pairing button select a new device
func selectDevice(inout deviceString: String) {

    // Prompt user for list of devices
    var prompt = IOBluetoothDeviceSelectorController.deviceSelector()
    var promptRes = Int(prompt.runModal())

    if promptRes == kIOBluetoothUISuccess {
        self.selectedDevice = prompt.getResults()[1] as? IOBluetoothDevice
    } else {
        self.selectedDevice = nil

    // Update the button status

I'm new to swift so I except the issue to be fairly stupid ;-)


Does your app print anything to the console, or is anything printed to the system console log? Maybe your app is running sandboxed but doesn't have the bluetooth entitlement added?

Your Answer

