I have an apk which I\'ve signed and uploaded to Android Market, and installed on my phone. I would like to debug this release apk (by means of Eclipse) whilst it is running
In case of you decided the debug your apk which is already in market but not assigned to be debuggable and you do not want to publish it again. So follow the below steps;
apktool d <APK_PATH>)android:debuggable="true" in application tagapktool b <MODIFIED_PATH>)I tried with the following and it's worked:
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Add the following to your app build.gradle and select the specified release build variant and run
signingConfigs {
config {
keyAlias 'keyalias'
keyPassword 'keypwd'
storeFile file('<<KEYSTORE-PATH>>.keystore')
storePassword 'pwd'
}
}
buildTypes {
release {
debuggable true
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
Besides Manuel's way, you can still use the Manifest.
In Android Studio stable, you have to add the following 2 lines to application in the AndroidManifest file:
android:debuggable="true"
tools:ignore="HardcodedDebugMode"
The first one will enable debugging of signed APK, and the second one will prevent compile-time error.
After this, you can attach to the process via "Attach debugger to Android process" button.

I know this is old question, but future references. In Android Studio with Gradle:
buildTypes {
release {
debuggable true
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
The line debuggable true was the trick for me.
Update:
Since gradle 1.0 it's minifyEnabled instead of runProguard. Look at here
Be sure that android:debuggable="true" is set in the application tag of your manifest file, and then: