adb命令操做藍牙

打開和關閉藍牙BT
  adb root
  adb shell svc bluetooth enable
  adb shell svc bluetooth disablejava

UI層android

查詢:adb shell settings get global bluetooth_onshell

 

查詢:adb shell settings get global bluetooth_on接口

獲取mac地址:get

1. adb shell settings get secure bluetooth_addressservice

2. service call bluetooth_manager 13方法

其中: bluetooth_manager: [android.bluetooth.IBluetoothManager] 是Bluetooth相關services提供給上層的接口call

13 是IBluetoothManager接口中的第13個方法:String getAddress();(注:該值不一樣平臺可能不同,最終根據IBluetoothManager.aidl肯定。 在/system/bt/binder/android/bluetooth/ 或 /frameworks/base/core/java/android/bluetooth/下)查詢

相關文章
相關標籤/搜索