How can i set Android:Debuggable false

2019-07-31 18:49发布

问题:

I want change debuggable properties to false.

BuildConfig.DEBUG

This line always return true.

i tried add

Android:debuggable false in androidmanifest.xml but nothing change.

and i tried add in gradle files.

  buildTypes {
debug {
    debuggable true
    buildConfigField "Boolean", "DEBUG_MODE", "true"
}

    release {
        buildConfigField "Boolean", "DEBUG_MODE", "false"
        debuggable false
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

But nothing changed again.

My apk should be not debuggable.

Thanks in advance.

回答1:

this value shows that you have run your application in debug mode. it will be false when you generate a signed apk that will be of release build type.

actually you can use this value to see if the application is running in debugging state (by you while developing you application) or is being used by a user through a signed apk release.