Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB shell bluetooth commands [duplicate]

I am working on automating bluetooth actions on android like enable/disable, pairing/unpairing devices etc.

I want to know how to interact with unrooted android device for above mentioned bluetooth operations using adb shell commands or android intents.

For example, i want to know which devices are bluetooth paired with my android phone using adb shell commands.

is it possible?

like image 301
vasanthfriend Avatar asked Sep 04 '14 06:09

vasanthfriend


People also ask

How do I run multiple commands in adb shell?

But, in order to execute several commands in one line, you may use adb shell "cmd1;cmd2;cmd3" .


1 Answers

dumpsys is your friend:

  • Find your bluetooth service (must be running): adb shell dumpsys -l
  • Mine is bluetooth_manager, so I run: adb shell dumpsys bluetooth_manager
  • In output you can find section "Bonded devices"
like image 162
lojza Avatar answered Oct 12 '22 01:10

lojza