【问题标题】:enable notification access using adb使用 adb 启用通知访问
【发布时间】:2021-05-16 13:46:14
【问题描述】:

我有一个监听接收通知的应用程序。安装后,我应该从设置 -> 安全 -> 通知访问

启用对它的通知访问

我在模拟器上安装这个应用程序并使用 ADB 运行它。但我不知道如何使用 ADB 中的命令行为其启用通知访问设置。我看到 this question 并猜测它的一般答案是正确的,但我找不到实际的设置名称。感谢您的考虑。

【问题讨论】:

    标签: adb android-notifications


    【解决方案1】:

    自 Android 9 以来,接受的答案不再有效。对我有用的是使用:

    adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener
    

    【讨论】:

    • 确认在 Android Q TV 模拟器上无需 root 即可工作
    【解决方案2】:

    我找到了答案here 只需输入:

    adb shell settings put secure enabled_notification_listeners %nlisteners:com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept
    

    听众后面没有空格

    .....

    【讨论】:

    • 我有一部已植根的手机,我正在尝试同样的方法,但似乎没有任何想法?这是我的命令: adb shell settings put secure enabled_notification_listeners %nlisteners: mypackageName/com.company.app.service.CallNotificationListener
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-10
    相关资源
    最近更新 更多