How to downgrade an android App(wechat) without losing chat history

In android, once upgraded from a lower version to a higher one. It cannot roll back since the system does not allow an apk with a lower version comparing to current version to be installed with a error code [INSTALL_FAILED_VERSION_DOWNGRADE].

C:\Phone\Download>adb install “tencent.mm_7.0.6–1500_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com.apk”
adb: failed to install tencent.mm_7.0.6–1500_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

But if uninstall the app, all the data got deleted. two year of chat history iwll be gone. To backup the several GB data and restore it will be a headache. Someone says it can use adb install -r -d <packet name> to install the lower version forcefully. I tried by failed.

L:\Phone\Download>adb install -r -d “tencent.mm_7.0.6–1500_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com.apk”
adb: failed to install tencent.mm_7.0.6–1500_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

then 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)

when running adb uninstall -k, the prompt says it should use

adb shell cmd package uninstall -k packet nameC:\Phone\Download>adb shell cmd package uninstall -k com.tencent.mm
Success

well, all the configure and cache are kept. Need to restart phone, otherwise, install is still not allowed. after rebooting the phone, install will success.

C:\Phone\Download>adb install “tencent.mm_7.0.6–1500_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com.apk”
Success

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store