Home » Android » android – INSTALL_FAILED_ALREADY_EXISTS when trying to install APK-package

android – INSTALL_FAILED_ALREADY_EXISTS when trying to install APK-package

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’m having 2 versions of my Android application.
One developer version and one production version. I want to install both versions on my phone.

I get this message:

./adb install application.apk 
1829 KB/s (177760 bytes in 0.094s)
    pkg: /data/local/tmp/application.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

Is there any way to get around this failure without uninstall my develop version?

How to&Answers:

You should change the package in order to let android to differ your versions as package name is a unique identifier of an application.

Answer:

adb install -r InfoTest.apk means you uninstall before install -r remove purpose
.//adb uninstall InfoTest.apk

Or

Export your app with different .apk location but same signature for both.

means Version code 1.0 for dev
Version code 2.0 for production
using same keystroke file and certificate.

if you change certificates then install two apps with the same name on emulator/device.