如何管理调试和Android设备发布的版本?版本、设备、Android

2023-09-05 02:12:17 作者:空心印ヽ

我是新来的Andr​​oid开发人员,我几乎准备释放我的应用程序的第一个版本:)

I'm new to Android dev and I'm almost ready to release a first version of my app :)

在测试我的手机上签署发布的apk,它拒绝安装,因为调试版本与调试签名安装。

While testing the signed release apk on my phone, it refuse to install because the debug version is installed with the debug signature.

所以,我必须卸载调试版本,但它删除所有我的数据库(它会做到这一点给我的朋友谁是测试它)。

So I have to uninstall the debug version but it delete all my database (and it will do it to my friends who are testing it).

有没有办法来管理调试和相同的应用程序的发布版本,而不会丢失数据?

Is there a way to manage a debug and a release version of the same app without losing data?

推荐答案

我不知道有任何简单的方法来解决卸载/重新安装过程,所以你的选项包括...

I'm not aware of any easy way to do get around the uninstall/reinstall process, so your options include...

购买第二设备进行测试(一些Android设备都非常便宜了,尤其是在eBay上) 使用模拟器来测试

我看到了同样的问题,但它是可以预料的,所以我用手机进行调试开发和平板电脑进行生产测试。当我接近发布,我测试的量产版两个设备和仿真器上。

I see the same issue, but it's to be expected, so I use the phone for debug dev, and the tablet for production testing. When I'm close to a release, I test the production version on both devices and the emulator.

使用您的测试人员,我建议你总是给他们发布的版本,但你可能包括广泛的日志记录,以帮助有问题的。调试版本则只能由你,他们发布的版本。如果您提供的测试人员提供一个发布版本,他们使用,并积累数据,当他们升级到下一个版本,可以将数据保留(或更新的,如果你改变架构)迁移其数据。

With your testers, I'd advise that you always give them release versions, but you could include extensive logging to help with problems. Debug versions are then only used by you, and release versions by them. If you provide testers with a release version, they use, and accumulate data, when they come to upgrade to the next version, the data can be retained (or updated, if you change the schema) to migrate their data.

我不认为有必要为您的测试人员使用调试和放大器;发行版本。

I don't see a need for your testers to be using debug & release versions.