In short, add this to the app build.gradle
:
android {
buildTypes {
release {
debuggable true
...
}
}
}
After this, we can just build a relase APK as normal. Run the app -> Attach the debugger -> See log as normal.
Don't use the Manifest
method as any field with the Debug enable will be defualt into a debug build instead of a release build.