更新时间: 2023-03-10 - Android 12/13
通过cmd
启用蓝牙
adb shell cmd bluetooth_manager enable
禁用蓝牙 cmd
adb shell cmd bluetooth_manager disable
更新:2019-06-22: - Android 11
通过settings
打印当前蓝牙状态
adb shell settings get global bluetooth_on
adb shell settings list global |grep ^bluetooth_on
通过设置
启用蓝牙
adb shell settings put global bluetooth_disabled_profiles 1
禁用蓝牙 设置
adb shell settings put global bluetooth_disabled_profiles 0
通过content
启用蓝牙
adb shell content insert \
--uri content://settings/global \
--bind name:s:bluetooth_disabled_profiles \
--bind value:s:1 --user 0
禁用蓝牙 内容
adb shell content insert \
--uri content://settings/global \
--bind name:s:bluetooth_disabled_profiles \
--bind value:s:0 --user 0
Android 11/12/13以及早期版本
启用蓝牙
adb shell settings put global bluetooth_on 1
禁用蓝牙
adb shell settings put global bluetooth_on 0
通过activity manager
启用蓝牙
adb shell am broadcast \
-a android.intent.action.BLUETOOTH_ENABLE
通过活动管理器
禁用蓝牙
adb shell am broadcast \
-a android.intent.action.BLUETOOTH_ENABLE
通过 keyevents
启用/禁用蓝牙
adb shell am start \
-a android.settings.BLUETOOTH_SETTINGS \
adb shell input keyevent 19
adb shell input keyevent 23