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?
As soon as you execute an ‘adb shell’ command on the command terminal, it sends a signal to your Android device and triggers the remote shell command console. Thus ADB shell commands let you control your Android device.
To enable & disable Bluetooth using below adb commands needs your device to be rooted or if you are working on android development, your android should be userdebug build with root access.,
ADB Shell commands provide access to a Unix Shell that runs a command directly on your Android device. As soon as you execute an ‘adb shell’ command on the command terminal, it sends a signal to your Android device and triggers the remote shell command console. Thus ADB shell commands let you control your Android device.
The Android Debug Bridge (adb) provides a Unix shell that you can use to run a variety of commands on an emulator or connected device. The command binaries are stored in the file system of the emulator or device, at /system/bin/... You can use the shell command to issue commands, with or without entering the adb remote shell on the emulator/device.
dumpsys is your friend:
adb shell dumpsys -l
adb shell dumpsys bluetooth_manager
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With