为什么 adb 安装 <same-packagename-always-release>失败? [英] Why does adb install <same-packagename-always-release> fail?

查看:19
本文介绍了为什么 adb 安装 <same-packagename-always-release>失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆