【问题标题】:How to use Android Settings App's SettingsDumpService.dump() method如何使用 Android Settings App Settings DumpService.dump() 方法
【发布时间】:2018-05-27 20:04:36
【问题描述】:

我正在调试与数据使用收集相关的 Android 问题。我的应用程序提供的值与 Android 默认设置应用程序中报告的值不同。例如:

在调查时我发现了NetworkStatsService 的源代码,它允许我使用adb shell dumpsys netstats --full 来调用它的dump() 方法。

我还找到了SettingsDumpService 的源代码,但没有看到从 dumpsys 调用它的方法。我查看了 AndroidManifest.xml 并且服务在那里:

<service
    android:name=".SettingsDumpService"
    android:exported="true"
    android:permission="android.permission.DUMP" />

我使用了adb shell am startservice com.android.settings/.SettingsDumpService,它似乎正在运行。但我似乎没有看到该类在任何地方建议的预期 JSON 输出。

我还尝试了开发人员选项中的“生成调试报告”按钮,但在输出中的任何位置都没有看到我想要的数据。这是否仅供 AOSP 开发人员在内部使用,还是有办法让我也可以将其用于调试/调查?

【问题讨论】:

    标签: android android-source


    【解决方案1】:

    Android Emulator: How can I get a list of services that are running

    adb shell dumpsys activity service com.android.settings/.SettingsDumpService
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-03
      • 1970-01-01
      • 2014-12-09
      • 2015-12-26
      • 1970-01-01
      • 2010-11-09
      相关资源
      最近更新 更多