Error text
Failure [INSTALL_FAILED_VERSION_DOWNGRADE] Package com.example.app new version 5 is older than the installed version 8
Failure [INSTALL_FAILED_VERSION_DOWNGRADE] Package com.example.app new version 5 is older than the installed version 8
The versionCode of the APK you install is lower than the one on the phone. Android refuses to go backwards.
adb shell dumpsys package pkg | grep versionCode.versionCode in build.gradle above it.adb install -r -d app.apk (for debuggable APKs).versionCode.adb shell dumpsys package com.example.app | grep versionCode adb install -r -d app.apk # build.gradle: versionCode = 9
Increase versionCode automatically in CI (for example from the build number).
Author and license: Nibras Code