简体   繁体   中英

How to sign debug APK's with the same key as release APK's - Android Studio

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM