【问题标题】:Find connected bluetooth device name using adb? [duplicate]使用 adb 查找连接的蓝牙设备名称? [复制]
【发布时间】:2018-06-26 19:47:40
【问题描述】:

有没有办法使用 adb shell 找到连接的 BT 设备名称

我的手机已root,我正在构建一个 tasker 配置文件,该配置文件在连接时会闪烁 BT 设备名称。

【问题讨论】:

    标签: android shell adb tasker


    【解决方案1】:

    您想知道您的蓝牙配置文件名称或连接/配对设备的蓝牙名称吗?

    您可以通过以下命令获取这两个名称:

    adb shell dumpsys bluetooth_manager
    

    上面的命令会给出这样的输出:

    Bluetooth Status
      enabled: true
      state: STATE_ON
      address: A4:70:D6:80:56:3E
      name: Moto G (4) (This is your device name)
      time since enabled: 00:03:29.979
    
    Bonded devices:
      C0:EE:FB:DA:70:6E [BR/EDR] Oneplus3 (This is connected device name)
      ...................................
      ...................................
    

    【讨论】:

    • 我只想要连接设备的名称。绑定设备列表显示多个 BT 设备,第一个总是连接的吗?您还可以提供一种方法来解析此转储以获取连接的 BTdevice 的名称。谢谢。
    • Bonded devices 列表是与您查询的安卓设备配对的设备。您可以使用 adb shell "dumpsys bluetooth_manager | grep name:" 将结果过滤为您正在查询的 Android 设备的名称
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-05
    相关资源
    最近更新 更多