2 years ago

#17367

test-img

BeginnersMindTruly

UUID of connected bluetooth device on MacOS

I am trying to find the UUIDs of all connected bluetooth devices on MacOS Big Sur 11.6.2. I have the MAC addresses of all connected devices (obtained running: system_profiler SPBluetoothDataType) but not the UUIDs. I need the UUIDs because I would ultimately like to connect to specific devices programmatically using the bleak library in python3 which requires a UUID when run on MacOS.

I tried using this answer:

$ xcrun xctrace list devices
xcrun: error: unable to find utility "xtrace", not a developer tool or in PATH`

I do have XCode CLT installed (and just reinstalled it today to attempt a fix):

$ xcode-select -p
/Library/Developer/CommandLineTools

but it does not have the xctrace utility:

$ pwd
/Library/Developer/CommandLineTools/usr/bin
$ ls -al
drwxr-xr-x  116 root  wheel       3712 Jan  5 16:49 .
drwxr-xr-x    7 root  wheel        224 Jan  8  2021 ..
...
-rwxr-xr-x    1 root  wheel     336096 Jun  8  2021 DeRez
-rwxr-xr-x    1 root  wheel     167184 Jun  8  2021 GetFileInfo
-rwxr-xr-x    1 root  wheel     168912 Jun  8  2021 ResMerger
-rwxr-xr-x    1 root  wheel     337904 Jun  8  2021 Rez
-rwxr-xr-x    1 root  wheel     167408 Jun  8  2021 SetFile
-rwxr-xr-x    1 root  wheel     168416 Jun  8  2021 SplitForks
-rwxr-xr-x    1 root  wheel     172048 Jun  8  2021 ar
-rwxr-xr-x    1 root  wheel     153744 Jun  8  2021 as
-rwxr-xr-x    1 root  wheel     166752 Jun  8  2021 asa
-rwxr-xr-x    1 root  wheel     532720 Jun  8  2021 bison
-rwxr-xr-x    1 root  wheel     443904 Jun  8  2021 bitcode_strip
lrwxr-xr-x    1 root  wheel          5 Jan  5 16:48 c++ -> clang
lrwxr-xr-x    1 root  wheel         12 Jan  5 16:48 c++filt -> llvm-cxxfilt
-rwxr-xr-x    1 root  admin     167648 Jun  8  2021 c89
-rwxr-xr-x    1 root  admin     167680 Jun  8  2021 c99
lrwxr-xr-x    1 root  wheel          5 Jan  5 16:49 cc -> clang
-rwxr-xr-x    1 root  wheel  167669296 Jun  8  2021 clang
...
-rwxr-xr-x    1 root  wheel   33012928 Jun  8  2021 tapi
-rwxr-xr-x    1 root  wheel    3141104 Jun  8  2021 tapi-analyze
-rwxr-xr-x    1 root  wheel     168528 Jun  8  2021 unifdef
-rwxr-xr-x    1 root  wheel       2946 May 21  2021 unifdefall
-rwxr-xr-x    1 root  wheel     207840 Jun  8  2021 unwinddump
-rwxr-xr-x    1 root  wheel     224816 Jun  8  2021 vtool
-rwxr-xr-x    1 root  wheel     888000 Dec  2 19:07 xcindex-test
-rwxr-xr-x    1 root  wheel     202048 Jun  8  2021 xml2man
-rwxr-xr-x    1 root  wheel        135 May 21  2021 yacc

I have also used the bleak library example to scan for all devices in range:

import asyncio
from bleak import BleakScanner

async def main():
    devices = await BleakScanner.discover()
    for d in devices:
        print(d)

asyncio.run(main())

but the devices to which I would like to connect do not have any identifying names / vendors / models:

DAA5ECF7-840A-4C7D-8524-61125710005B: Unknown
0D2CFE18-CC2E-4D1C-80E1-72E60FFC7912: Unknown
EC98C45E-F513-4F82-8657-5818F9E9C5DC: Unknown
7D98B33B-2D6F-44C6-8257-7B35073DD734: Unknown
7A2079CD-F4AB-4D32-921C-50C3F1A54455: Unknown
779307AA-4F2B-4F77-851A-5CCD82DDC477: Unknown
567051B7-6942-4792-9E68-6B633942ED1A: 3950A391AFC6
C0A1D009-1F27-44B2-94A6-BE0B9DEC287D: Unknown
7B37A97E-C10C-4A39-A6DF-0506865624BF: Unknown
BD3FDB6B-D976-4DB2-B985-C91DB58AE940: Unknown
274AFE19-C89D-47CA-AB0B-D6F46361E305: Unknown
5E1D7D49-FF1F-4B42-AFB3-BC368D56226C: Unknown
EB47338F-32F3-4E2A-B948-ADB03460D819: Unknown
6C0AD807-482C-4A5B-9944-E1AAF3A12A99: Unknown
6D8D27C1-07F5-42E5-98C0-AEBC1339ADE2: Unknown
86A0189E-45C7-40FF-9420-3C80D7FA8FF5: Unknown
E9B79F24-60A5-4FBF-A15E-BDC2635DDE4E: Unknown

One of these is the device to which I would like to connect programmatically using the UUID that corresponds to the MAC address that I already know from using the (Option key + Bluetooth) menu shortcut.

I would like to avoid downloading and installing the full XCode package if at all possible. Thanks for your suggestions.

python-3.x

xcode

macos

bluetooth

core-bluetooth

0 Answers

Your Answer

Accepted video resources