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

AndroidApkAdb

Android Problem Overview


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?

Android Solutions


Solution 1 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionan00bView Question on Stackoverflow
Solution 1 - Androidalex.zherdevView Answer on Stackoverflow