Reputation: 32103
I have a release APK which I have signed, uploaded to Google Play and installed on my Android device. I would like to debug this APK (by means of Android Studio or Eclipse) whilst it is running on my Android device. I have done this before and I remember it being with one of the Android development tools (perhaps Dalvik Debug Monitor). Sadly, I cannot remember how to do it and I have been unable to find any articles online. Does anybody know how I can do this?
android:debuggable="true"
in the app's manifest file.Upvotes: 149
Views: 155440
Reputation: 180
Add debuggable true
in release
in buildTypes
and turn on 'release' in botton left Build Variants
on Android studio
Source: https://mobikul.com/release-variant-of-app-enable-logcat-running-release-build-application/
It work me!
Can you try it
Upvotes: 3
Reputation: 2376
I know this is old question, but future references. In Android Studio with Gradle:
buildTypes {
release {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
The line debuggable true
was the trick for me.
Before Gradle 1.0 it was runProguard
instead of minifyEnabled
. Look at here.
Upvotes: 176
Reputation: 1114
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'
}
}
Upvotes: 11
Reputation: 668
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>
)Upvotes: 13
Reputation: 21531
I tried with the following and it's worked:
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Upvotes: 13
Reputation: 41749
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.
Upvotes: 44
Reputation: 40734
Be sure that android:debuggable="true"
is set in the application
tag of your manifest file, and then:
Upvotes: 91