Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start Bluetooth from ADB or at boot?

Is it possible to start Bluetooth from ADB without user intervention? I tried:

am start -a android.bluetooth.adapter.action.REQUEST_ENABLE

but this require the user to press ok. And:

service call bluetooth 3

doesn't do anything. Enabling the bluetoothd service in init.rc doesn't work either.

service bluetoothd /system/bin/bluetoothd -n
    class main
    socket bluetooth stream 660 bluetooth bluetooth
    socket dbus_bluetooth stream 660 bluetooth bluetooth
    # init.rc does not yet support applying capabilities, so run as root and
    # let bluetoothd drop uid to bluetooth with the right linux capabilities
    group bluetooth net_bt_admin misc
    enabled

And I would prefer a command from ADB. (If anyone is wondering I need it for FCC testing.)

like image 581
thomas.fogh Avatar asked Aug 28 '13 19:08

thomas.fogh


1 Answers

On a rooted device

adb shell service call bluetooth_manager 8

works for me.

like image 163
Danw25 Avatar answered Sep 21 '22 07:09

Danw25