本文转载于:https://www.cnblogs.com/liuliu-word/p/10910662.html
打开和关闭蓝牙BT:
adb root
adb shell svc bluetooth enable
adb shell svc bluetooth disable
查询蓝牙开启状态:
adb shell settings get global bluetooth_on
=》0: 未开启 1: 已开启
获取mac地址:
方法1:
adb shell settings get secure bluetooth_address
=》如:00:00:00:00:00:01
方法2:
adb shell adb shell 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/下)