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/下)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM