简介
基于blueutil的Mac蓝牙管理工具,支持查看设备连接状态与电量,一键配对连接断开,让蓝牙设备管理更高效便捷。
原始描述
蓝牙设备监控 / Bluetooth Device Monitor - 查看Mac已连接的蓝牙设备列表,支持配对、连接、断开操作
中文使用说明 来自收录源
功能概述
bluetooth-monitor 是一款专为 macOS 设计的蓝牙设备管理命令行工具,通过封装 blueutil 和 system_profiler 系统工具,提供简洁直观的蓝牙设备监控能力。核心功能包括:实时查看已连接/已配对设备列表、显示设备电量百分比(带进度条可视化)、手动连接或断开指定蓝牙设备、开关蓝牙电源状态。
显著优点
本地化安全架构:纯 Shell/Bash 实现,零外部网络依赖,所有数据本地处理,彻底杜绝隐私泄露风险。安全认证评分 85 分,获 S 级评级,六维检测全部通过。
轻量无侵入:仅 305 行代码,3 个文件,无第三方依赖库,除需手动安装 blueutil 外零配置即用。对系统性能零影响,后台无驻留进程。
操作直观:支持 MAC 地址直连操作,终端彩色输出提升可读性,命令行语义清晰(connected/paired/connect/disconnect/power),学习成本极低。
潜在局限
平台限制:仅支持 macOS,且需 10.14+ 版本;Windows/Linux 用户无法使用。依赖 blueutil 需通过 Homebrew 手动安装,对无 brew 环境的用户增加门槛。
设备兼容性:部分老款蓝牙设备(尤其非 Apple 生态)不支持电量报告;MAC 地址需严格遵循连字符格式(XX-XX-XX-XX-XX-XX),冒号格式不被识别。
功能边界:仅支持被动查询和基础连接控制,不支持蓝牙文件传输、音频路由切换、设备重命名等高级功能;无 GUI 界面,纯命令行交互。
适合人群
- 高频使用蓝牙外设(Magic Keyboard/Trackpad/AirPods)的 macOS 开发者/极客用户
- 需脚本化自动化管理蓝牙连接的场景(如定时断开节省电量)
- 偏好终端工具、追求轻量替代系统偏好设置的高级用户
- 对隐私敏感、拒绝云端服务的本地优先主义者
常规风险
- 依赖维护风险:
blueutil若停止更新可能导致未来 macOS 版本兼容性问题 - 输入误操作风险:MAC 地址手动输入错误可能导致命令失败,建议配合 shell 补全或脚本封装
- 权限提示:首次使用 system_profiler 可能触发系统权限弹窗,属正常行为
- 电量显示不准:第三方设备电池信息依赖厂商实现,数值可能存在延迟或偏差
技能正文
name: bluetooth-monitor description: "蓝牙设备监控 / Bluetooth Device Monitor - 查看Mac已连接的蓝牙设备列表,支持配对、连接、断开操作"
蓝牙设备监控 / Bluetooth Device Monitor
监控和管理Mac的蓝牙设备,支持查看连接状态、配对管理等功能。
Monitor and manage Mac Bluetooth devices with connection status viewing and pairing management.
功能特性 / Features
-
📱 查看已连接设备 / Connected Devices - 列出当前所有已连接的蓝牙设备
- List all currently connected Bluetooth devices
-
🔋 电量显示 / Battery Level - 显示设备电量百分比和进度条
- Display device battery percentage with progress bar
-
🔗 查看已配对设备 / Paired Devices - 列出系统所有已配对的蓝牙设备
- List all paired Bluetooth devices in the system
-
🔌 连接设备 / Connect Device - 手动连接到指定蓝牙设备
- Manually connect to a specified Bluetooth device
-
⏏️ 断开设备 / Disconnect Device - 断开指定蓝牙设备的连接
- Disconnect a specified Bluetooth device
-
📊 蓝牙状态 / Power Status - 查看蓝牙开关状态
- View Bluetooth power status
使用方法 / Usage
1. 查看已连接设备 / View Connected Devices
bluetooth-monitor connected
2. 查看已配对设备 / View Paired Devices
bluetooth-monitor paired
3. 连接设备 / Connect Device
# 连接设备(需提供设备地址)
# Connect to device (device address required)
bluetooth-monitor connect "XX-XX-XX-XX-XX-XX"
4. 断开设备 / Disconnect Device
bluetooth-monitor disconnect "XX-XX-XX-XX-XX-XX"
5. 查看蓝牙电源状态 / View Power Status
bluetooth-monitor power
6. 打开/关闭蓝牙 / Turn On/Off Bluetooth
bluetooth-monitor power on
bluetooth-monitor power off
设备地址获取 / Device Address
-
运行
bluetooth-monitor connected查看已连接设备的地址 -
Run
bluetooth-monitor connectedto view addresses of connected devices -
运行
bluetooth-monitor paired查看所有配对设备的地址 -
Run
bluetooth-monitor pairedto view all paired device addresses
常用设备地址格式 / Common Device Address Format
08-65-18-B9-9C-B2 (Magic Trackpad)
1C-1D-D3-7A-68-D4 (Magic Keyboard)
注意事项 / Notes
⚠️ 需要安装 blueutil: brew install blueutil
⚠️ Requires blueutil: brew install blueutil
⚠️ 部分老款蓝牙设备不支持电量报告 ⚠️ Some older Bluetooth devices may not report battery level
⚠️ 设备地址需使用连字符格式 (XX-XX-XX-XX-XX-XX) ⚠️ Device address must use hyphen format (XX-XX-XX-XX-XX-XX)
数据来源 / Data Source
使用 blueutil CLI 获取蓝牙信息 Uses blueutil CLI to retrieve Bluetooth information
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。