默认情况下,当我将 Build Variants
更改为 release
时,logcat 上没有任何日志,但我确实需要阅读我的应用程序的发布日志,我怎样才能启用它?
最佳答案
添加 android:debuggable="true"
(默认为 false)到您的 list 中 <application>
标签。
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.
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/