为什么 adb 安装 <same-packagename-always-release>失败? [英] Why does adb install <same-packagename-always-release> fail?
问题描述
我知道 adb install
不会替换现有包,如果它是不同的构建类型(即调试与发布).
I know that adb install
will not replace an existing package if it's of a different build type (i.e. debug vs. release).
每当我运行调试会话时,Eclipse 也会成功替换调试 apk.
Eclipse also successfully replaces the debug apks whenever I run a debug session.
但是当我尝试 adb install
将现有的 release apk 替换为另一个版本的 apk(相同的包名称!)时,我收到一条失败消息:
But when I attempt adb install
for replacing an existing release apk with another release apk (same package name!), I get a failure message:
adb install myapp-release.apk
pkg: /data/local/tmp/myapp-release.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
745 KB/s (34310 bytes in 0.044s)
这不应该起作用吗?我错过了什么?
Wasn't that supposed to work? What am I missing?
推荐答案
我想如果应用程序已经安装,你需要提供 -r
键:
I suppose if the app is already installed, you need to supply the -r
key:
adb install -r myapp-release.apk
来自 adb
帮助:
'-r' means reinstall the app, keeping its data
这篇关于为什么 adb 安装 <same-packagename-always-release>失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!