With the new Gradle build system, the recommended way is to assign this in the build types.
In your app module's build.gradle:
android {
//...
buildTypes {
debug {
debuggable true
}
customDebuggableBuildType {
debuggable true
}
release {
debuggable false
}
}
//...
}