MacOS – Where does macOS Get Icons for W1 Audio Devices

airpodsbluetoothmacos

I recently noticed that macOS has an icon for every W1 enabled audio device in the Bluetooth preferences, but I'm not exactly sure where the system gets these icons.

In the screenshot below, the Beats Solo³ and AirPods were paired to my iPhone, and iCloud paired them to my Mac. It looks like the color of the Beats headphones in the icon do match the color of the real headphones as well!

I assume that either macOS has the images for every W1 stored somewhere or the system had to contact Apple to get these images. Just in case, I did check the following directory:

/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources

enter image description here

Best Answer

I was able to find where icons are stored for W1 devices. It appears that this folder already contains assets for every W1 device that exists. You can find icons for W1 devices here:

/System/Library/Frameworks/IOBluetoothUI.framework/Versions/A/Resources

If you're using Swift on macOS, you can use the following code to programmatically get a device image:

IOBluetoothDevice.init(addressString: "bluetoothDeviceAddress").value(forKey: "image")

or

   for device in IOBluetoothDevice.pairedDevices() {
    let deviceName = ((device as! IOBluetoothDevice).name)
    let deviceImage = (device as! IOBluetoothDevice).value(forKey: "image")
}