Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)?

like image 676
level0 Avatar asked Sep 21 '15 03:09

level0


People also ask

How do I set Debuggable to true?

Show activity on this post. By putting android:debuggable="true" in your manifest file, application will go in debug mode, that means android will manage all logs file regarding your application. But make sure put it again false (or remove this tag) if application will going to live or for release mode.

Where is the application gradle File?

gradle file is located inside your project folder under app/build. gradle.

What is a Debuggable application?

Android allows the attribute android:debuggable to be set to true in the manifest, so that the app can be debugged. By default this attribute is disabled, i.e., it is set to false , but it may be set to true to help with debugging during development of the app.


2 Answers

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 -

enter image description here

like image 83
Varundroid Avatar answered Oct 07 '22 11:10

Varundroid


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

like image 37
Dekra Avatar answered Oct 07 '22 10:10

Dekra