Why does adb install <same-packagename-always-release> fail? [duplicate]

允我心安 提交于 2019-12-20 09:22:08

问题


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 also successfully replaces the debug apks whenever I run a debug session.

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?


回答1:


I suppose if the app is already installed, you need to supply the -r key:

adb install -r myapp-release.apk

From the adb help:

'-r' means reinstall the app, keeping its data


来源:https://stackoverflow.com/questions/9053791/why-does-adb-install-same-packagename-always-release-fail

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!