简体   繁体   中英

How to update Play store downloaded APK from ADB android studio generated APK with with same key store

Earlier PlayStore downloaded APK can be replaced by android studio generated APK with same key store via ADB command.

But now after google app singing opt-in am not able to override the APK.

How to update the google derived APK from original APK via ADB command

The reason you're not able to update is that the APK installed on your device is now signed with the upload key whereas Google signs the APK with the release key, and Android doesn't allow updates on an app if the newer APK isn't signed with the same certificate.

You have a couple of options available: - If you have kept a copy of your release key, you can keep signing your APK with that key on Studio for your local testing. The downside is that you'll have to build two separate APKs: one to install on your device (signed with the release key) and one to upload on the Play Console (signed with the upload key). - Reconsider your testing flow so that you only install on a given device APKs coming from a single source, either Studio or Play.

Hope that helps.

@Pierre is right. I found a workaround for this. Here's how

  1. Go to releases in Google Play Console

  2. Create a new release upload your APK, then delete your your release

  3. Then go "Artifact Library" (still under "Release Management")

  4. Find your APK there click the ↓ to download it choose "Derive APK" you can identify by it's version code

  5. This will update your existing APK from Google Play via ADB without a problem

Edit: based on @Jarvis comment

No you can't debug the APK you download from "Artificat library", if you would like to have both release and debug versions I suggest you create different package names based on the build, you can do this in gradle like:

buildTypes {

    release {
        // Yada yada, nothing to add here
    }

    debug {
        applicationIdSuffix '.debug' // This will add .debug to your original package name 
        versionNameSuffix ' - DEBUG' // The will -DEBUG to your version name
    }

}

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