If you are running a release build of an application, then you most likely do not have it written in gradle debuggable true .
buildTypes { release { debuggable true } }
The second way to enable logs in the release assembly is to specify this attribute in the manifest via the attribute of the Application tag.
android:debuggable="true"
The best option is to configure the options for the assembly so that you can enable / disable the logs for the release assembly in various ways like this:
buildTypes { debug { resValue "bool", "debuggable", "true" } release { } } productFlavors { dev { resValue "bool", "debuggable", "true" } prod { resValue "bool", "debuggable", "false" } }
In the manifest, provide a link to the generated gradl resource:
android:debaggable="@bool/debuggable"
Now you can build the devRelease build with enabled logs and prodRelease with disabled. And debug builds will always be enabled.