
system_profiler SPBluetoothDataType | sed -n "/Apple Bluetooth Software Version\:/,/Manufacturer\:/p" | egrep -o '([[:xdigit:]]{1,2}-){5}[[:xdigit:]]{1,2}'
这个命令也会提供相同的信息。
system_profiler SPBluetoothDataType | sed -n "/Apple Bluetooth Software Version\:/,/Manufacturer\:/p" | tr -s "[\n]" "[ ]" | sed "s:.*Address\: ::g" | sed "s: Manufacturer\:.*::g" | grep "[[:graph:]]"
这两个命令也可以在终端中使用,以获取单台机器的蓝牙ID。
networksetup命令并提取蓝牙接口地址。
networksetup -listallhardwareports | awk '/Bluetooth/ {n[NR+2]}; {if (NR in n) print $3 }'