android通过命令行启用禁用蓝牙 [英] android enable disable bluetooth via command line
本文介绍了android通过命令行启用禁用蓝牙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用命令行在 android 设备上启用禁用蓝牙.
I am trying to enable disable bluetooth on android device using command line.
我可以使用
adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
但它会提示用户允许"或拒绝".
But it prompts user to 'allow' or 'deny'.
我还看到有选项可以先启动 ble 设置,例如
I also see there is option to launch ble settings first like
adb shell am start -a android.settings.BLUETOOTH_SETTINGS
然后启用禁用adb shell input keyevent **
但它不会独立于设备.
推荐答案
启用:
adb shell service call bluetooth_manager 6
禁用:
adb shell service call bluetooth_manager 8
这篇关于android通过命令行启用禁用蓝牙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文