我有一个侦听接收通知的应用程序。安装后,我应该通过设置->安全->通知访问权限来启用对它的通知访问
我在模拟器上安装了这个应用程序,并使用ADB运行它。但我不知道如何使用ADB.I中的命令行为其启用通知访问设置。我看到this question,并猜测它的一般答案是正确的,但我找不到实际的设置名称。感谢您的考虑。
发布于 2018-02-20 18:48:07
我发现答案here只需键入:
adb shell settings put secure enabled_notification_listeners %nlisteners:com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept
侦听器后面没有空格
.
发布于 2019-08-21 22:22:16
从Android 9开始,公认的答案就不再起作用了。对我起作用的是使用:
adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener
https://stackoverflow.com/questions/48855434
复制相似问题