android - 如何在不root的情况下获取Android 4.1用户的android日志?

标签 android logging sdk root ddms

从Android 4.1开始获取android log需要ROOT权限,所以现在不可能了 要求用户使用 LogCollector 等应用程序发送日志,该应用程序仅获取 Android 日志并将其发送到电子邮件。 Android 日志可以使用 Android SDK 中的 ddms 应用程序查看,但要求用户安装 Android SDK 并不好。

那么,如何在不root的情况下获取Android 4.1用户的android日志呢?

最佳答案

您现在无需许可即可获取自己应用的日志。无论是否获得许可,您根本无法读取其他应用程序的日志。

这在某种程度上有记录here 。请引用 Diane Hackborn 的回复:

The change is that third party applications can no longer get the read logs permission, however every app can read the logs containing only the lines they have written, without needing any permission.

Keep in mind that access to the logs has never been part of the SDK, and is still not part of the SDK. If you are relying on it then, even after this change, you run the risk of breaking in the future. (And that is partly why this got lost for documentation, it is not part of the SDK, so there isn't really a place to document it, in fact documenting it would kind-of make it a part of the SDK which we don't want. :p)

关于android - 如何在不root的情况下获取Android 4.1用户的android日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14641063/

相关文章:

javascript - 在android中提取exif数据(phonegap)

javascript - 在 Nativescript ListView 中显示项目

android - 在 Osmdroid 覆盖层上禁用 onClick 事件

python - 在Python中跨不同模块记录到单个文件

java - 如何在 Java 的日志文件中记录来自 Web 服务(POST)的一些记录?

android - 动态更改 fragment 选项卡主机内的 fragment ?

java - log4j自定义配置

android - SDK 17 中的库 - android

java - 使用 python 的 Android 应用程序

Android Studio - 如何从抽屉导航中打开另一个 fragment