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
Just use com.intangibleobject.securesettings.plugin. It allows all kinds of bluetooth shenanigans, aswell as conn/disconnecting devices one by one.
To enable:
adb shell service call bluetooth_manager 6
To disable:
adb shell service call bluetooth_manager 9
Tested and worked on a Samsung Galaxy S7.
To enable
svc bluetooth enable
To disable
svc bluetooth disable
For folks who are wondering from where did the numbers 6 and 8 came from. It came from this aidl file: https://android.googlesource.com/platform/system/bt/+/master/binder/android/bluetooth/IBluetoothManager.aidl Start counting from the first function listed in this aidl and you will see the enable function is the 6th one and the disable is the 8th one in the list.