简体   繁体   English

为什么“ adb install -r”会卸载旧版本的应用程序?

[英]Why would “adb install -r” uninstall the old version of the app?

I'm testing a complete rebuild of my application and want to make sure that the update will go smoothly. 我正在测试应用程序的完整重建,并希望确保更新能够顺利进行。 I'm having an issue when I have the old version and perform the "adb install -r" command. 我使用旧版本并执行“ adb install -r”命令时遇到问题。 What I expect to happen is it just replaces the old version with the updated version. 我希望发生的事情是它只是用更新的版本替换了旧版本。 What happens is that the command line reports success but all it did was uninstall the old version and did not install the new version. 发生的情况是命令行报告成功,但所做的只是卸载旧版本而未安装新版本。 I have tested this on a Galaxy Nexus with 4.2 and I have this problem but when I tested this on an S2 with 4.0 it works as expected and replaces the old version. 我已经在带有4.2的Galaxy Nexus上进行了测试,但是遇到了这个问题,但是当我在带有4.0的S2上进行了测试时,它可以按预期工作并替换了旧版本。 Any ideas why this would happen on the GS and not the S2? 有什么想法为什么会在GS而不是S2上发生? Also will this happen to my users when they try to update the app from the market? 当我的用户尝试从市场上更新应用程序时,也会发生这种情况吗?

As far as I know, three things are important: 据我所知,三件事很重要:

  • Package name; 包裹名字;
  • Signing key; 签名密钥;
  • Version code. 版本代码。

If the two firsts are identical, and the last one properly incremented, there should be no problem. 如果两个首个相同,并且最后一个适当增加,则应该没有问题。 Moreover, Google Play will reject your update if those things are not correct. 此外,如果这些操作不正确,Google Play将拒绝您的更新。

Was there a LogCat error message on the Galaxy Nexus? Galaxy Nexus上是否有LogCat错误消息?

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

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