其他分享
首页 > 其他分享> > 蓝牙相关杂记

蓝牙相关杂记

作者:互联网

1、打开蓝牙

adb shell service call bluetooth_manager 6

或者service call bluetooth_manager 6 s16 "com.android.bluetooth"

 

2、关闭蓝牙

adb shell service call bluetooth_manager 8

或者service call bluetooth_manager 8 s16 "com.android.bluetooth" i32 1

 

3、查看蓝牙信息

adb shell dumpsys bluetooth_manager

 

4、允许被发现---需要按键确认

adb shell am start -a android.bluetooth.adapter.action.REQUEST_DISCOVERABLE

 

5、获取蓝牙开关状态

adb shell settings get global bluetooth_on

返回1表示开启,0表示关闭

 

6、获取蓝牙MAC地址

adb shell settings get secure bluetooth_addressv

标签:shell,service,蓝牙,bluetooth,manager,杂记,相关,adb
来源: https://blog.csdn.net/jlgcumt/article/details/118092913