I have the Playstore application installed on my mobile! I want to debug that mobile application with my debug APK of the same project. Is there any way to debug that application? I don't want to uninstall the existing application for data. Right now I am getting a signature error when I try to install debug APK over Playstore APK.
-
Do you want to install both PlayStore apk and debug apk on device? – adityakamble49 Jul 20 '18 at 05:11
-
you cant override play store apk with debug if thats what your intent is. – Sahil Jul 20 '18 at 05:14
-
I want to debug the data of that application can I install the debug APK alongside with Playstore App and accessing the data of the same application? – moiz ahmed Jul 20 '18 at 05:15
-
@Sahil yes sahil that is what I want. – moiz ahmed Jul 20 '18 at 05:32
1 Answers
In case you need to install both PlayStore apk and your Debug Apk on device you can use build types applicationIdSuffix as below
Add this to your app level build.gradle
android {
...
buildTypes {
debug {
applicationIdSuffix ".debug"
}
release {
// Change to true if you want to apply ProGuard minify
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
...
}
Using this applicationIdSuffix ".debug"
when you build debug apk and install it from android studio it will append .debug
on your existing package name
for example
PlayStore package name : com.example.myapp
Debug Package name : com.example.myapp.debug
In this way you can keep both the versions of your apk on device and debug your apk as you want.
Edit 1
If you are using Google Services with google-services.json you may face following errors
- Error:Execution failed for task ':app:processDebugGoogleServices'. - Solution
- No matching client found for package name - Solution
This is because of google-services.json need to match the package name and you need to have multiple google-services.json if you want to have multiple app flavors like Debug and Release
So as per Google Documentation
The google-services.json file is generally placed in the app/ directory (at the root of the Android Studio app module). As of version 2.2.0 the plugin supports build type and product flavor specific JSON files. All of the following directory structures are valid:
// dogfood and release are build types.
app/
google-services.json
src/dogfood/google-services.json
src/release/google-services.json
...

- 1,971
- 18
- 27
-
I am getting this error while compiling Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'org.ird.android.norad.debug' – moiz ahmed Jul 20 '18 at 05:22
-
It looks like you are using google services with google-services.json right? In that case follow instructions here to manage google-services.json for different flavours https://stackoverflow.com/a/34364376/3624647 – adityakamble49 Jul 20 '18 at 05:25
-
No matching client found for package name we are getting kind of an error – Rajan Bhavsar Jul 20 '18 at 05:28
-
@RajanBhavsar Its the same. Checkout above link or this one https://stackoverflow.com/a/34990999/3624647. It explains how to manage google-services.json for multiple flavours – adityakamble49 Jul 20 '18 at 05:29