0

Is there any way to find the connected BT device name using adb shell?

My phone is rooted and I'm building a tasker profile which flashes the BT device name when connected.

GorvGoyl
  • 42,508
  • 29
  • 229
  • 225

1 Answers1

2

You want to know your Bluetooth profile name or connected/paired device bluetooth name?

Both names you can get by below command:

adb shell dumpsys bluetooth_manager

The above command will give the output like this:

Bluetooth Status
  enabled: true
  state: STATE_ON
  address: A4:70:D6:80:56:3E
  name: Moto G (4) (This is your device name)
  time since enabled: 00:03:29.979

Bonded devices:
  C0:EE:FB:DA:70:6E [BR/EDR] Oneplus3 (This is connected device name)
  ...................................
  ...................................
Chandrakanth
  • 3,711
  • 2
  • 18
  • 31
  • i want the name of the connected device only. bonded devices list is showing multiple BT devices, is the first one always the connected one? also could you provide a way to parse this dump to get just the name of the connected BTdevice. Thanks. – GorvGoyl Jul 02 '18 at 13:11
  • The list of `Bonded devices` are devices paired with the android device that you're querying. You can filter your results to just the name of the android device that you're querying by using `adb shell "dumpsys bluetooth_manager | grep name:"` – Naftoli Ost Jan 27 '22 at 14:07