Which gradle file to use to set the application as debuggable?

寵の児 提交于 2019-12-05 16:48:26

问题


I am newbie to android development. I have just started setting up my device to debug my application. while going through android develop tools it says to set buildTypes debuggable to true in build.gradle file . I am not sure which grade file to use gradle.build(Module) or gradle.build(project)?


回答1:


There are two gradle files in your project -

  1. Top level
  2. App level

You need to add it to your app level gradle file -

YourApplicationRootFolder -> app -> build.gradle

You need to add it like this -

buildTypes {
        debug {
            debuggable true
        }

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

Look at this image to get a better idea -




回答2:


Debug buildType makes build debuggable by default; instead, Release buildType makes build not debuggable by default. If you want to change this behaviour, you can define in your module app the property debuggable (boolean) as you need. Gradle properties



来源:https://stackoverflow.com/questions/32687046/which-gradle-file-to-use-to-set-the-application-as-debuggable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!