adb命令操作蓝牙

打开和关闭蓝牙BT
  adb root
  adb shell svc bluetooth enable
  adb shell svc bluetooth disable

UI层

查询:adb shell settings get global bluetooth_on

查询:adb shell settings get global bluetooth_on

获取mac地址:

1. adb shell settings get secure bluetooth_address

2. service call bluetooth_manager 13

其中: bluetooth_manager: [android.bluetooth.IBluetoothManager] 是Bluetooth相关services提供给上层的接口

13 是IBluetoothManager接口中的第13个方法:String getAddress();(注:该值不同平台可能不一样,最终根据IBluetoothManager.aidl确定。 在/system/bt/binder/android/bluetooth/ 或 /frameworks/base/core/java/android/bluetooth/下)

原文地址:https://www.cnblogs.com/liuliu-word/p/10910662.html