adb install: Install and Update APKs in CI
adb install transfers an APK to the target and runs the package manager to install it, returning Success or an INSTALL_FAILED reason.
Installing the build under test is step one of every Android UI pipeline. The failure messages are specific and actionable, so read the exact INSTALL_FAILED code rather than just retrying.
What it does
adb install copies an APK to the device and invokes pm install. Flags control reinstall (-r), allowing test-only packages (-t), granting runtime permissions (-g), and downgrades (-d). For app bundles split into multiple APKs, use install-multiple.
Common usage
adb install app-debug.apk
adb install -r -t -g app-debug.apk # reinstall, allow test apk, grant perms
adb install-multiple base.apk split_config.arm64_v8a.apk
adb -s emulator-5554 install app-release.apkOptions
| Flag | What it does |
|---|---|
| -r | Reinstall, keeping the app data |
| -t | Allow installing a test-only (android:testOnly) APK |
| -g | Grant all runtime permissions at install time |
| -d | Allow version code downgrade |
| -s | Install to the shared/SD storage (where supported) |
| install-multiple | Install a set of split APKs as one app |
In CI
Use -r -t -g when installing a debug build for UI tests so a version bump does not fail, a testOnly manifest is accepted, and no permission dialog blocks the test. bundletool-produced universal APKs install with plain adb install; split sets need install-multiple.
Common errors in CI
"INSTALL_FAILED_UPDATE_INCOMPATIBLE: signatures do not match" means an app with a different signing key is already installed; uninstall it first (adb uninstall <pkg>). "INSTALL_FAILED_INSUFFICIENT_STORAGE" needs a bigger emulator partition or a cleanup. "INSTALL_FAILED_TEST_ONLY" means you forgot -t. "INSTALL_FAILED_NO_MATCHING_ABIS" means the APK lacks the emulator ABI (use an x86_64 emulator image).