As of today, in-app-update testing can not be done for a debug build. You don't need to put your apk to PlayStore to test also. The best way to test in-app-update
is by using internal-app-sharing
.
If you follow the below steps one-by-one, you'll be able to test successfully.
- To test the app, a tester has to first enable Internal-App-Sharing in PlayStore, follow this link for the same, How to Enable Internal App Sharing for Android?
- If you're brave enough to understand the official documents, then simply follow this link to set-up
in-app-update
testing in your device, https://developer.android.com/guide/playcore/in-app-updates#internal-app-sharing
Here, I'll be writing the same in easy words.
Once you're done with setting up internal-app-sharing
in Play-Store
, make sure that you have to upload 2 apks to internal-app-sharing on Play-Console
and hence generate 2 links. Both apks will be signed using the same signing-key
(need not be the same as the one you use to sign for production, any dummy signing-key would work).
- First you upload an apk with in-app-update implementation with lower VersionCode (say, 100) to internal-app-sharing on play console.
To know, How to upload apk to internal-app-sharing on Play-Console, follow this lisk, https://support.google.com/googleplay/android-developer/answer/9844679?visit_id=637437125318137239-1277036129&rd=1
NOTE: make sure, you have uninstalled any preinstalled app with the same package-name in your device.
- Now you copy the link of the app you uploaded to internal-app-sharing on the play console and use this link to install the app on your device.
NOTE: Before installing, make sure the email-id you're using on play-store has been added in the mail-list on internal-app-sharing on play-console.
Now, once you've installed the app using the link. Now, you need to again create a new signed apk with higher VersionCode (say, 101). And upload this apk to internal-app-sharing.
Now, copy the link with higher VersionCode from internal-app-sharing. Click on this link on your device, it will take you to play-store but this time, update
button will be enabled rather than install
button as app is already installed in your device with lower VersionCode.
You don't have to click the update button on PlayStore. You just have to click the link and hence open the screen on PlayStore. Now close PlayStore app.
Now, you can launch the already installed app from your device.
If your implementation of in-app-update is fine, launching the app would appear the dialog from PlayStore for update.
Lastly, don't forget to upvote if it helps you in any way. Keep
Coding!