I'm writing some end-to-end tests of an Android-TV-App using Python and my own implementation of the ADB-Protocol. This works fine so far, I can send commands, get ui-dumps ect.
However, since the app is only available on the Google Play Store (I don't have access to any source code) and I want to update the version of the app every week, I'm wondering how I can do this using ADB.
I thought about following solutions:
Whats "best practice" on this and how should i solve my problem?
Here is how I would have done it.
1.First open the app page in playstore
adb shell am start -a android.intent.action.VIEW -d 'market://details?id=com.yourpackagename'
2.Then send touch on the install/update button.
adb shell input tap <x> <y> (Default: touchscreen)
Download APK locally using Google Play Downloader via Command line and install it with adb.
$ gplaycli -s 'App Inspector'
Title Creator Size Downloads Last Update AppID Version Rating
App Inspector Projectoria 895.04KB 100,000+ downloads 14 Jul 2019 bg.projectoria.appinspector 8 4.53
...
$ gplaycli -d bg.projectoria.appinspector
$ adb install bg.projectoria.appinspector.apk
Performing Streamed Install
Success
The answer worked for me on one phone without problem.
adb shell am start -a android.intent.action.VIEW -d 'market://details?id=com.yourpackagename'
But on other phones it was not working, throwing an error. You can fix that error (will edit tomorrow with the exact error) by removing the single quote (') from the command:
adb shell am start -a android.intent.action.VIEW -d market://details?id=com.yourpackagename
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