I am trying to enable disable bluetooth on android device using command line.
I can enable it using
adb shell am start -a android.bluetooth.adapter.ac
I do not have enough reputation points to add a comment so I am following up on TripeHound's comment on wuseman's answer.
I tried TripeHound's way of setting the Bluetooth global setting (
adb shell settings put global bluetooth_on 1
) on a Samsung Galaxy Tab A (SAMSUNG SM-T515 running Android 10, Kernel 4.4.177) and it does indeed seem to work. However, the Bluetooth icon will not show the change when opening the quick-settings menu nor will it show the change when you go to the full settings menu.
That said, if I restart the tablet immediately after it will indeed reboot with the correct state so I am not sure whether it is necessary to re-read the global settings somehow to ensure that the Bluetooth radio is actually off.
Comments appreciated!