简体   繁体   English

如何在Google Play上测试应用更新?

[英]How to test app update on Google Play?

Let's say I have the app in Google Play Store with version 1.0. 假设我在Google Play商店中使用的是版本1.0的应用程序。

In the new version (1.1) I would like to upgrade the database with new columns. 在新版本(1.1)中,我想用新列升级数据库。

Database upgrading is a common crash in my application because users in previous version (1.0) doesn't have the new columns in the database. 数据库升级是我的应用程序中的常见崩溃,因为先前版本(1.0)中的用户在数据库中没有新列。

I have tried to use the Google Play Store's beta testing feature, but the problem is there is no effective way (or at least I haven't found one yet) to do the following: 我曾尝试使用Google Play商店的Beta版测试功能,但问题是没有有效的方法(或者至少我还没有找到),以便执行以下操作:

Install a the current stable version (1.0) to the tester's device, then update the application to (1.1) - let's say we got an error during the playtest of the new updated version (1.1), I repair it (1.2) and I would like to repeat the procedure, I would like to install the 1.0 stable app to the tester's device and yet again I would like to update the app to 1.2 (with the resolved error) 将当前稳定版本(1.0)安装到测试仪的设备,然后将应用程序更新为(1.1) - 假设我们在新的更新版本(1.1)的游戏测试期间出现错误,我修复它(1.2)我会想重复这个程序,我想将1.0稳定的应用程序安装到测试人员的设备上,然后我想再次将应用程序更新为1.2(已解决的错误)

The only way (as far as I concern) is to remove the beta tester from the beta testing list (could take hours to refresh in Google Play systems), re-download the 1.0 application, re-add the tester to the beta testing list, (again waiting hours) and download the new 1.2 application. 唯一的方法(据我所知)是从beta测试列表中删除beta测试人员(在Google Play系统中可能需要数小时刷新),重新下载1.0应用程序,将测试人员重新添加到beta测试列表,(再次等待数小时)并下载新的1.2应用程序。

Is there a more sophisticated way to test app version updates? 是否有更复杂的方法来测试应用版本更新?

Thanks in advance. 提前致谢。

EDIT: 编辑:

It would be nice if I could do this with other people testing my app. 如果我可以与其他人测试我的应用程序,这将是很好的。 So the less programing and command prompt usage needed the solution is the better. 因此,解决方案所需的编程和命令提示符使用越少越好。

You don't need the Play Store for testing database upgrade. 您不需要Play Store来测试数据库升级。
You can just use an emulator. 你可以使用模拟器。 Drag&Drop version 1.0 (this will install the app), open the app, and Drag&Drop version 1.1. 拖放版本1.0(这将安装应用程序),打开应用程序,拖放版本1.1。

There isn't any real "upgrade" feature. 没有任何真正的“升级”功能。 It's just an install of the new version. 这只是新版本的安装。

By the way, you can add the news columns in onUpgrade of SQLiteOpenHelper . 顺便说一句,您可以在SQLiteOpenHelper onUpgrade中添加新闻列。

I use Beta for painless beta distributions for iOS and Android apps. 我将Beta用于iOS和Android应用程序的无痛beta发行版。

From: Overview 来自: 概述

You want feedback early and often throughout your development lifecycle. 您希望在整个开发生命周期中尽早并经常获得反馈。 With Beta, you can easily send beta builds to your users. 使用Beta,您可以轻松地向用户发送测试版。 You'll automatically get usage stats and stability metrics for all your builds, so you know when you're ready to ship. 您将自动获取所有构建的使用情况统计信息和稳定性指标,以便了解何时准备发货。

I find it very useful and use beta in conjunction with crashlytics for crash reporting. 我发现它非常有用,并将beta与crashlytics一起用于崩溃报告。 Below are the advantages: 以下是优点:

  • You can automate the build with Android Automation for Continuous Delivery and has support for beta via gradle. 您可以使用Android Automation进行持续交付自动化构建,并通过gradle支持beta版。
  • Build is available instantly to all the testers. 所有测试人员都可以立即使用Build。
  • All builds are archived and can is available at anytime. 所有构建都已存档,并且可以随时使用。
  • Dynamically add QA engineers, track progress, add QA engineers dynamically by creating and sharing the build. 动态添加QA工程师,跟踪进度,通过创建和共享构建动态添加QA工程师。
  • Access to all build release notes with build(apk) and build version. 使用build(apk)和构建版本访问所有构建发行说明。
  • Further more if the build is approved by QA engineers, one can directly upload the same apk to playstore with fastlane from gradle itself. 更进一步,如果构建得到QA工程师的批准,可以直接从gradle本身使用fastlane将相同的apk上传到playstore。

I'd recommend to backup your data to easily test and tweak your migration code. 我建议您备份数据,以便轻松测试和调整迁移代码。 This only works on the emulator or a rooted device! 这仅适用于模拟器或root设备!

  1. Install and use your "old" app 安装并使用“旧”应用
  2. Save data via adb pull /data/data/com.company.app $LOCALDIR 通过adb pull /data/data/com.company.app $LOCALDIR保存数据
  3. Update to your new app version via IDE or adb 通过IDE或adb更新到您的新应用版本
  4. Test your migration 测试您的迁移

No need to install the old app again from now on. 从现在开始,无需再次安装旧应用程序。

For retrying the migration: 1. adb push $LOCALDIR /data/data/com.company.app 2. Test your migration 3. Fix your migration code and repeat 要重试迁移,请执行以下操作: adb push $LOCALDIR /data/data/com.company.app 2.测试迁移3.修复迁移代码并重复

You really don't need the beta channel to test app updates. 您真的不需要测试版渠道来测试应用更新。 You only want to use the beta channel once you are done testing and want to start receiving user feedback. 一旦完成测试并希望开始接收用户反馈,您只想使用测试版通道。

To test an app update the most basic way would be to... 要测试应用更新,最基本的方法是...

  1. Uninstall any current installation of your app 卸载您应用的任何当前安装
  2. Install the latest PlayStore version 安装最新的PlayStore版本
  3. Open the app, log in, do whatever it needs to fill your database and settings 打开应用程序,登录,执行填充数据库和设置所需的任何操作
  4. Install the new, updated App version. 安装新的,更新的App版本。 This has to be signed with your release keystore or the update will fail 必须使用您的发布密钥库进行签名,否则更新将失败
  5. Test the app update 测试应用更新

Fix errors and repeat. 修正错误并重复。


Step 1. is to make sure you get the PlayStore version as your users would. 1.步是确保您按照用户的身份获得PlayStore版本。 Uninstallation is the best way to make sure the app data is cleared. 卸载是确保清除应用程序数据的最佳方法。 Afterwards you just install the app as any user would in 2. . 然后你就像2.任何用户一样安装应用程序。

You have to at least open your app once, or it will not run. 您必须至少打开一次应用程序,否则它将无法运行。 Populate your app with data, as a user would, so that you can properly test the update. 使用数据填充您的应用程序,以便您可以正确测试更新。 The 3. step is to set up your test data. 3.步骤是设置测试数据。

In step 4. keep in mind that you only need an app that is signed with your release keystore, but it can still be debuggable . 在第4.步中,请记住,您只需要一个使用您的发布密钥库签名的应用程序,但它仍然可以调试 You can still attach a debugger and check what's going on in case there are more serious errors. 您仍然可以附加调试器并检查发生了什么,以防出现更严重的错误。
If you properly configured your build.gradle file you can just press the Play button in Android Studio after selecting the release build variant. 如果您正确配置了build.gradle文件,则可以在选择发布版本变体后按Android Studio中的“播放”按钮。 You can either modify the release config to be debuggable while testing, or create a third buildType that is release signed, but debuggable. 您可以在测试时将发布配置修改为可调试,或者创建第三个已发布签名但可调试的buildType。

Have fun testing. 玩得开心测试。


If you're using a VCS 如果您使用的是VCS

If you use a version control system (VCS)—which I really hope that you do—you can also just build & install a previous version before updating with your latest snapshot. 如果您使用版本控制系统(VCS) - 我真的希望您这样做 - 您还可以在使用最新快照进行更新之前构建并安装以前的版本。 The same steps apply, only that in step 2. you build and install a previous version yourself. 相同的步骤仅适用于步骤2.您自己构建并安装以前的版本。
Compared to using release versions of your app, this might be easier in some cases, because you don't need access to the release keystore and you can just use debug signed apps without the need to change anything in your build.gradle. 与使用应用程序的发行版本相比,在某些情况下这可能更容易,因为您不需要访问发布密钥库,只需使用调试签名的应用程序而无需更改build.gradle中的任何内容。

This approach requires that you keep track of which version is currently released, or you might testing the wrong updates. 此方法要求您跟踪当前发布的版本,或者您可能会测试错误的更新。 So keep sure to tag your releases! 所以一定要标记你的版本!

As I understand the main question was not related to database but for general possibility "How to check that update from version 1 to version 2 will gone fine for end user?" 据我所知,主要问题与数据库无关,但一般情况下“如何检查从版本1到版本2的更新对最终用户来说会没问题?”

I found the way to do it with Internal app sharing . 我找到了使用内部应用程序共享的方法 This is a place where you can put your APK versions, setup emails for test users who can access your APKs. 在这里,您可以放置​​APK版本,为可以访问APK的测试用户设置电子邮件。

Go to

Google Play Console > Development Tools > Internal app sharing > Upload link Google Play控制台>开发工具>内部应用程序共享>上传链接

在此输入图像描述

You can Drag & Drop needed APKs and then provide the Link for test users to download specific APK. 您可以拖放所需的APK,然后为测试用户提供下载特定APK的链接。

在此输入图像描述

It works for me exactly how I expected. 它对我来说完全符合我的预期。

Now I can check on the Android device that next updates will be successful for my users. 现在我可以在Android设备上查看下一次更新对我的用户是否成功。

0.0.9 to 0.0.11 0.0.9至0.0.11

0.0.10 to 0.0.11 0.0.10至0.0.11

This is quite easy and you can test it by changing the database version yourself. 这很简单,您可以通过自己更改数据库版本来测试它。 You don't even need to update version code in your manifest file. 您甚至不需要更新清单文件中的版本代码。 My answer is valid if you are using a SQLite database and SQLiteOpenHelper class. 如果您使用的是SQLite数据库和SQLiteOpenHelper类,我的答案是有效的。

First, increase database version inside SQLiteOpenHelper class. 首先,在SQLiteOpenHelper类中增加数据库版本。

public DatabaseOpenHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

When you update version of constructor onUpgrade() method of SQliteHelper class will be invoked. 当您更新构造函数onUpgrade()的版本时,将调用SQliteHelper类的方法。 You can test it by using println or log methods. 您可以使用println或log方法对其进行测试。

    @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    this.oldVersion = oldVersion;
    this.newVersion = newVersion;

    if(oldVersion == 1 && newVersion == 2) {
          // add columns
    } else if(oldVersion == 2 && newVersion == 3) {
         // Do another stuff
   }
}

You can define your logic between updates. 您可以在更新之间定义逻辑。 For example an user may have version with 1, miss version 2 and 3 and install update with version 4 of database, you should consider that too if necessary. 例如,用户可能拥有版本1,错过版本2和3并使用版本4的数据库安装更新,如有必要,您也应该考虑。 Updating logic is unique to you. 更新逻辑是您独一无二的。

For example, if users have old version below a certain version and you wish to create a new db or table on a specific version,all users have versions below 6 and you wish to delete database or table on version 6, you can get all values from tables to list or lists or to any data structure, then create new database and/or tables and then move new values from that list that contains objects and add null properties for new columns to new tables. 例如,如果用户的旧版本低于某个版本,并且您希望在特定版本上创建新的数据库或表,则所有用户的版本低于6,并且您希望在版本6上删除数据库或表,则可以获取所有值从表到列表或列表或任何数据结构,然后创建新的数据库和/或表,然后从该列表中移动包含对象的新值,并将新列的空属性添加到新表。 Users won't notice a thing but behind the scenes you will be able to change database or tables without no problem. 用户不会注意到任何事情,但在幕后您可以毫无问题地更改数据库或表。 I use this often when i wish to add rows or recreate database. 当我想添加行或重新创建数据库时,我经常使用它。

if (oldVersion == 2 && newVersion == 3) {

        previousMeasures = dbManager.getMeasureListAnglePhoto();
        db.execSQL("DROP DATABASE dbOld.db");
        db.execSQL("DROP TABLE IF EXISTS " + TableConstants.TABLE_ANGLE_PHOTO);

       onCreate(db);

      if (previousMeasures != null) {
        for (Measure measure : previousMeasures) {
            dbManager.addMeasureAnglePhoto(measure);
        }
    }
}

You must use a "work mode" previously provided. 您必须使用以前提供的“工作模式”。

Every release you compile (the one compiled in release) on androidstudio and deposits on the playstore you have to keep it locally, you have to keep track of everything you've done previously and to do this it's good to use a special tool. 您在androidstudio上编译的每个版本(在发布中编译的版本)以及您必须在本地保存它的Playstore上的存款,您必须跟踪您之前完成的所有操作,并且这样做最好使用特殊工具。 I personally use the "subversion" application, but one is as good as the other. 我个人使用“颠覆”应用程序,但其中一个与另一个一样好。

1) Manually install (without using googleplay) the old apk (the verison release NOT THE DEBUG VERSION) on the devices (taking it from the subversion application). 1)在设备上手动安装(不使用googleplay)旧的apk(verison release NOT THE DEBUG VERSION)(从subversion应用程序中获取)。

2) Take (always manually without using googleplay) the new version (NOT THE DEBUG VERSION) and install it ... the update will start and you can EXACTLY test what will happen on the devices. 2)采取(总是手动不使用googleplay)新版本(不是调试版本)并安装它...更新将开始,你可以完全测试设备上会发生什么。

If you are only interested in testing the update part of the database (onUpgrade to understand): 如果您只对测试数据库的更新部分感兴趣(onUpgrade要了解):

I in my app have a "button", visible only in the test phase, that launches a "restore database"; 我在我的应用程序中有一个“按钮”,仅在测试阶段可见,启动“恢复数据库”;

Install the apk NEW and launch the restore (from a button test) of any previous version (to do this you need to recover the database .db file of your previous version of the app) and in this way the OnUpgrade will start because you will notice that the restored database has a lower version. 安装apk NEW并启动任何先前版本的恢复(从按钮测试)(为此,您需要恢复以前版本的应用程序的数据库.db文件),这样OnUpgrade将启动,因为您将请注意,已还原的数据库的版本较低。

This is the only way I have found to test my updates without having to go crazy with betatester, googleplay, versioncode, upload, download, etc, etc ... it works! 这是我发现测试我的更新的唯一方法,而不必疯狂与betatester,googleplay,版本代码,上传,下载等等...它的工作原理!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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