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