android - 在 Android Studio 的发布版本中启用 LogCat

标签 android logcat

默认情况下,当我将 Build Variants 更改为 release 时,logcat 上没有任何日志,但我确实需要阅读我的应用程序的发布日志,我怎样才能启用它?

最佳答案

添加 android:debuggable="true" (默认为 false)到您的 list 中 <application>标签。

From the docs:

android:debuggable
Whether or not the application can be debugged, even when running on a device in user mode — "true" if it can be, and "false" if not.

respectively

You can disable debugging by removing the android:debuggable attribute from the tag in your manifest file, or by setting the android:debuggable attribute to false in your manifest file.

编辑

您可能需要将以下内容添加到您的 build.gradle android{...} 标签内的文件:

lintOptions {
   checkReleaseBuilds false
}

并且附带说明:无论您的应用程序的 debuggable 是否设置为 false 或 。但是通过 Android Studio 中的 LogCat,只有当 debuggable 设置为 true 时才有可能。 (刚刚测试过)

关于android - 在 Android Studio 的发布版本中启用 LogCat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25610936/

相关文章:

android - 为什么使用 Ivy 解决依赖关系在 Android 的 "-pre-build"Ant 目标中不起作用?

android - Eclipse LogCat 坏了

android - Eclipse 中的 Logcat 查看器令人讨厌地闪烁

android - FIWARE Orion Websocket支持

android - 禁用抽屉导航,在 fragment 中切换主页按钮/向上指示器

android - Android Web 浏览器的 RTMP 实时流媒体?

适用于 HTC/摩托罗拉的 Android 模拟器

android - 如何将 Timber 日志重定向到 Junit logcat

android - AbsListView unregisterIRListener() 被调用

Android 应用程序在启动时崩溃