Is there any way to ignore INSTALL_FAILED_VERSION_DOWNGRADE on application install with the Android Debug Bridge?
Solution 1
It appears the latest version of adb tools has an "allow downgrade flag" that isn't shown in the adb help, but it is shown in the "pm" help on the device. So use:
adb install -r -d <link to apk>
Solution 2
You can try and use adb uninstall -k <package>
and then installing the older apk.
From the adb usage guide:
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
I've tried it myself with my apk, and it seems to work for most of the data (some data like RawContacts was not saved)
Solution 3
Did you enabled Multiple account on your device (and push your apk via ADB)? If so you have to remove the apk in every account. After complete uninstall, your push will be OK.
Solution 4
For me only this works fine:
adb install -t -r -d myapp.apk
Btw, the app, which I want to replace, and downgrade is a system app
Solution 5
In my case it was a stale version of Google Play Services included with my project. I am using Android Studio. I ran an update on the SDK, and imported the updated library, and that error went away. So my suggestion: update to the latest libraries that are referenced by your project.
AaronMT
Updated on February 16, 2022Comments
-
AaronMT over 2 years
It seems like the most recent Android 4.2 has introduced this error condition on installation when one attempts to install an APK with a lower version. In prior versions of Android, one would be able to install older APK's simply via
adb install -r <link to APK>
. For debugging purposes, I frequently need to re-test older APK's; and the-r
flag would replace the older build in older Android versions. Is there a work-around here to ignore[INSTALL_FAILED_VERSION_DOWNGRADE]
?-
CommonsWare over 11 yearsYou mean, besides uninstalling the newer version?
-
AaronMT over 11 yearsCorrect; I assumed the
-r
flag would handle this. -
m2web about 10 yearsThis question also valid for cases where you have (somewhat incorrectly) misnumbered builds. E.g. maybe your v1.0 from a dev box has a higher versionCode than v2.0 from a build server.
-
-
Bahadır Yıldırım over 10 yearsIt appears that this command does not actually execute the uninstall, instead simply yielding a warning. The command to actually excecute this appears to be
adb shell pm uninstall -k <package>
. -
jedd.ahyoung over 10 yearsWhy was this downvoted? It may not be the best answer, but it seems like a viable solution (and perhaps the easiest) for someone who is new to this! Please leave comments for answers like this, as they are essential not only for the answerer, but for the readers who visit this question later. :-|
-
Pointer Null about 9 yearsThis is also useful for downgrading, if adb -d still complains as it did for me.
-
MarSoft over 8 yearsTried with
adb install -rd <apkfile>
which didn't work. Your versino (with options separated) works fine. Thanks! -
plaisthos over 8 yearsAnd it seems to be documented now! Just not that you have to use -r -d, -rd will not work
-
Derek Gogol about 8 yearsFor example, to uninstall (downgrade) Waze 4.0.0.2 and install version 3.9.5.3: adb install -r -d Waze_3.9.5.3.apk. This way you won't lose app data.
-
tasomaniac over 7 yearsThis is of course something that can be done. It is obvious already. The question is asking if there is a way to skip this check and allow downgrade. And the answer is yes. This answer basically says no.
-
bentolor over 6 yearsRestoring backup via Titanium Backup did not work. Fresh install did not work. Installing via APK and/or adb install did not work. This cost me 1,5h and your simple tip did the trick. Thanks!
-
Darpan almost 6 yearsSince Android 7 (Nougat), adb install -d no longer works unless the package is marked as debuggable. android.googlesource.com/platform/frameworks/base/+/921dd75
-
Benyamin Limanto about 4 yearsThis doesn't help with anything and should be explained why it need to done this way.
-
sir_brickalot over 3 yearsThis helped in the following situation: I uninstalled an app and restored an older version with Titanium Backup. After an automatic app update I tried to downgrade again with TB > hung up on restore; tried installing the APK manually > didn't work with the error "App not installed". So my take away is that TB falesly seems to install apps globally for all users. Samsung S9, Android 9.
-
arekolek over 3 yearsFor me it worked when I did
adb install -t -r -d app.apk
-
leonidaa over 3 years'grep' is not recognized as an internal or external command, operable program or batch file. grep is working on Unix like OS
-
android developer about 3 years@Darpan So for signed APKs, it's impossible to install older versions on top of new ones, right?