I want to test in-app purchasing within my app, but it seems impossible to do this with a regular debug APK through Android Studio? Has anyone done this before and if so what steps did you take to do it?
I was thinking to get around it I should try signing my debug APK's in the same way I sign my release APK's. How can I do this?
Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.
You can config that in your android studio, right click your project, chose the open module settings
Or if you are crazy about the hand-writen build scripts, here is a snapshot of code:
android {
signingConfigs {
release {
storeFile file(project.property("MyProject.signing") + ".keystore")
storePassword "${storePassword}"
keyAlias "${keyAlias}"
keyPassword "${keyPassword}"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.release
}
}
}
Just config your debug and release build type with same signingConfig.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With