如何使用 adb shell 控制蓝牙操作? [英] How to control bluetooth operations using adb shell?

查看:76
本文介绍了如何使用 adb shell 控制蓝牙操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Android 上自动执行蓝牙操作,例如启用/禁用、配对/取消配对设备等.

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

我想知道如何使用 adb shell 命令或 android 意图与无根 android 设备进行上述蓝牙操作交互.

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

例如,我想知道哪些设备使用 adb shell 命令与我的 android 手机配对.

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

有可能吗?

推荐答案

dumpsys 是你的朋友:

dumpsys is your friend:

  • 找到您的蓝牙服务(必须正在运行):adb shell dumpsys -l
  • 我的是bluetooth_manager,所以我运行:adb shell dumpsys bluetooth_manager
  • 在输出中,您可以找到绑定设备"部分

这篇关于如何使用 adb shell 控制蓝牙操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆