Trying to build and install an app on Android with
./gradlew installDebug
and it fails with INSTALL_FAILED_VERSION_DOWNGRADE
. In plain language, this means the APK I am trying to install has a lower version code than the one already on the device—which can happen when switching branches.
I know ADB has a command line option to ignore version codes and force a downgrade; how can I achieve the same when installing through gradle?