Test on 50,000+ Real Android and iOS Devices

Live and Automated Real Device Testing on 50,000+ iOS and Android Devices. No Need to Buy or Maintain Device Lab

adb install APK: How to Install, Update and Downgrade Apps From the Command Line

adb install APK guide: update without losing data, downgrade and permission flags, split APKs, multi-device installs and INSTALL_FAILED error fixes.

Summarise with AI

To install an APK via adb, you turn on USB debugging, confirm the device appears as a device in adb devices and then run adb install path/to/app.apk. On current Android versions this will also update an already installed app and preserve its data. You can add -d to allow a downgrade, -g to grant the manifest permissions and -s <serial> to select a particular device.

adb install is by far the quickest way to get a build onto a test phone without having to go via Android Studio or an app store. It's also the area where most of the sideloading issues manifest themselves (signature mismatches, downgrade blocks, missing splits, "more than one device" errors). This guide covers the commands and flags, split APKs from app bundles, a script that will install one build onto every connected device, the common INSTALL_FAILED errors and how to get the same build onto cloud devices for real device testing.

TL;DR

To install an APK with adb, enable USB debugging, confirm the phone shows as device in adb devices and run adb install path/to/app.apk. The same adb install command updates an installed app and keeps its data on current Android, as long as the new build is signed with the same key.

Which adb install Flags Do Testers Use Most?

  • Downgrade flag: adb install -d old-build.apk allows a lower version code and keeps app data. On production phones -d works only for debuggable builds, so a release build needs an uninstall first.
  • Permission flag: adb install -g app.apk grants every permission listed in the app manifest and skips runtime permission dialogs in automated runs. Leave it off when the test checks the permission prompts.
  • Device serial: With several devices attached, adb -s <serial> install app.apk or the ANDROID_SERIAL variable picks one. Without it, adb stops with the error "more than one device/emulator".

How Do You Fix the Common INSTALL_FAILED Errors?

  • INSTALL_FAILED_UPDATE_INCOMPATIBLE: The installed app and the new APK are signed with different keys. Install a build signed with the same key, or run adb uninstall on the package first, which deletes its data.
  • INSTALL_FAILED_VERSION_DOWNGRADE: The new APK has a lower version code than the installed app. Add -d for a debuggable build, or uninstall first for a release build.

How Do You Install Split APKs and App Bundles?

  • adb install split APK: adb install-multiple installs a base APK and its split APKs in one command, for splits you already have, such as those downloaded from the Play Console.
  • bundletool install-apks: adb install cannot take an .aab file, so to install APKs from an app bundle, build an .apks set with bundletool build-apks and install it with bundletool install-apks.

Can adb install Reach Cloud Real Devices?

  • TestMu AI Real Device Cloud: Cloud real devices do not attach to your local adb. Upload the APK through the App Testing dashboard or the upload API, which returns an lt:// app URL for Appium runs. Local adb reaches cloud devices: No.

What Do You Need Before Running adb install?

You need three things before ADB install will work: ADB (from the Android SDK Platform-Tools) on your PATH, USB debugging enabled in the phone's Developer options and the phone authorized for your computer. Our ADB setup guide takes you through all three on Windows, macOS and Linux.

Check the connection first:

adb devices

Each line shows a serial and a state. "Device" means ready.

"Unauthorized" means you haven't accepted the RSA prompt on the phone yet. If the list is blank, then it's a cable, driver or USB mode issue rather than an APK issue.

How Do You Install an APK With adb?

The basic adb install command takes the path to an APK file on your computer:

adb install app-debug.apk
  • Connect and authorize the device. Turn on USB debugging, connect the device and then accept the authorization prompt on the phone.
  • Check the device list. Run adb devices and make sure the device is showing as 'state device' not 'unauthorized'.
  • Install the APK. Run adb install path/to/app.apk (add -s with the serial if more than one device is connected).
  • Add flags for downgrades and permissions. -d allows a lower version code, -g grants manifest permissions and -r is only necessary on older devices.
  • Confirm the result. Make sure the output ends with Success. If it's showing Failure with an INSTALL_FAILED code, then fix the root cause and re-run.

adb streams the APK to the device's package manager, which installs it. A successful install is signified by 'Success' being printed as the final line.

If the app is already installed and signed with the same key, then current Android versions will just replace it and preserve its data. In the Android package manager source, the 'install' command treats -r as ignored and replaces by default; -r is still accepted, so old scripts and very old devices will continue to work. To have an install fail rather than replace, use -R (the source docs this as "disallow replacement of existing application" - you can check this on your device with adb shell pm help).

No device to hand? Just run the APK in your browser using an online APK emulator.

Android's adb documentation makes it clear that Android Studio will do the installs for you when you're running from the IDE. You therefore need to use adb install for builds that come from CI, from a teammate or from a release pipeline.

Which ADB Install Flags Should You Know?

These flags cover pretty much every testing requirement. Descriptions are taken from the Android adb reference (last updated 25th September 2026).

FlagWhat it doesWhen to use it
-rReinstall an existing app, keeping its data. Replacement is the default on current Android, so -r mainly matters for old devices and older scriptsKeep it in shared scripts that may run against very old devices
-RDisallow replacement of an existing app (current Android)Make a fresh-install test fail if a copy is already on the device
-dAllow version code downgrade (debuggable packages only, per the package manager's help text)Reproduce a bug on an older debug build
-gGrant all permissions listed in the app manifestSkip runtime permission dialogs in automated runs
-tAllow test APKs to be installedBuilds marked test-only, such as some debug outputs
--user <id>Install for one user only (default: all users); get the id from adb shell pm list usersWork profiles and multi-user devices
--fastdeployUpdate only the changed parts of the APKFast inner-loop installs during development
--incrementalInstall enough to launch, stream the restLarge APKs on supported devices; needs an APK Signature Scheme v4 file

Combine flags in one command. For example, this installs an older debug build and grants its permissions:

adb install -d -g old-debug-build.apk

Use -g only when you're not actually testing the permission prompts. If your test case is one that's checking what happens when the user denies camera access, then granting everything upfront will hide that path.

How Do You Install an APK on One Device When Several Are Connected?

Use -s with the device serial whenever more than one device or emulator is attached. Otherwise adb will just stop with the error adb: more than one device/emulator.

adb devices
# List of devices attached
# emulator-5554   device
# R58M12ABCDE     device

adb -s R58M12ABCDE install app-release.apk

# Same result with an environment variable
ANDROID_SERIAL=R58M12ABCDE adb install app-release.apk

Two shortcuts from the adb docs: -d sends the command to the only hardware device and -e to the only emulator. If you're running a lot of commands against a single device, then set ANDROID_SERIAL; -s will override that when both are set.

Note the two different -d flags. Prior to install adb -d selects the hardware device. After install adb install -d will allow a downgrade.

How Do You Install One APK on Every Connected Device?

This script installs one APK on each authorized device and exits non-zero if any install fails. It's effectively a CI step. It'll skip over devices that are in the unauthorized state and will treat the absence of a Success line as a failure.

#!/usr/bin/env bash
# install-on-all.sh: install one APK on each authorized device, fail if any install fails.
# Usage: ./install-on-all.sh path/to/app.apk [adb install flags such as -g -d]
set -euo pipefail

APK="${1:?usage: install-on-all.sh path/to/app.apk [flags]}"
shift
[ -f "$APK" ] || { echo "No such file: $APK"; exit 2; }
command -v adb >/dev/null || { echo "adb is not on PATH"; exit 2; }

mapfile -t SERIALS < <(adb devices | awk 'NR > 1 && $2 == "device" { print $1 }')
[ "${#SERIALS[@]}" -gt 0 ] || { echo "No authorized devices found"; exit 2; }

failed=0
for serial in "${SERIALS[@]}"; do
  out="$(adb -s "$serial" install "$@" "$APK" 2>&1)" || true
  if grep -q '^Success' <<<"$out"; then
    echo "$serial: installed"
  else
    echo "$serial: FAILED"
    echo "$out" | tail -n 3
    failed=1
  fi
done

exit "$failed"

Run it as ./install-on-all.sh app-release.apk -g. 0 exit code means the build installed on all devices, 1 means at least one failed (the final lines of adb's output for that serial are printed), and 2 means a setup issue (no file, no adb, no authorized devices, etc.). The script requires bash 4 or later for mapfile.

Test your website on the TestMu AI real device cloud

How Do You Install Split APKs and App Bundles (.aab)?

An Android App Bundle (.aab) can't be installed with adb install directly. You have to either install the individual split APKs or use bundletool to build and install them.

Two ways to install an Android App Bundle: bundletool install-apks or adb install-multiple with split APKs

Option 1: adb install-multiple. This is for the scenario where you already have the split APKs for a device (e.g. you've already downloaded them from the Play Console). The Android adb documentation describes it precisely in that scenario:

adb install-multiple base.apk split_config.arm64_v8a.apk split_config.en.apk split_config.xxhdpi.apk

Option 2: bundletool. Build an APK set from the bundle and then install the set. That's according to the bundletool documentation (as of August 28th, 2026):

# Build an APK set for the connected device only (smaller and faster)
bundletool build-apks --connected-device \
  --bundle=app-release.aab --output=app-release.apks

# Install it; add --device-id=<serial> if several devices are connected
bundletool install-apks --apks=app-release.apks

Without --ks signing flags, bundletool will sign the APKs with a debug key. That's important for the next section as a debug-signed build will not be able to update a release-signed app that's already on the device. To get one APK that will run on any device, simply add --mode=universal to build-apks.

MethodInputHandles splitsBest for
adb installOne .apkNoUniversal or single APKs from CI
adb install-multipleBase + split .apk filesYes, you supply themSplits downloaded from the Play Console
bundletool install-apks.apks set built from .aabYes, picks the right splitsTesting the exact split set Play would deliver
TestMu AI App Testing upload.apk, .aab or .ipa (dashboard)Done by the platformInstalling the same build on many real devices in the cloud

What Does Each INSTALL_FAILED Error Mean and How Do You Fix It?

adb prints out the package manager's reason for failure in square brackets.

Those are the most common failure modes that testers encounter. The causes are taken from the Android adb reference and Jason Bayton's Android install failure reference (last edited 26 June 2026).

ErrorCauseFix
INSTALL_FAILED_UPDATE_INCOMPATIBLEThe new APK's signature does not match the installed appInstall a build signed with the same key, or adb uninstall <package> first (this deletes app data)
INSTALL_FAILED_VERSION_DOWNGRADEThe APK's version code is lower than the installed oneAdd -d to allow the downgrade; if the device still refuses, uninstall first
INSTALL_FAILED_ALREADY_EXISTSThe package is already installed, and the install asked not to replace it (for example with -R, or on an old device without -r)Drop -R, or add -r on older devices
INSTALL_FAILED_TEST_ONLYThe APK is flagged test-onlyAdd -t, or build a normal debug or release variant
INSTALL_FAILED_OLDER_SDKThe app's minimum SDK is higher than the device's Android versionUse a device on a newer Android version, or check minSdk and the libraries that raise it
INSTALL_FAILED_NO_MATCHING_ABISThe APK has no native libraries for the device's CPU architectureBuild or download the APK for that ABI, or a universal APK
INSTALL_FAILED_INSUFFICIENT_STORAGEThe device is out of storageFree space and retry
INSTALL_FAILED_USER_RESTRICTEDThe current device user is not allowed to install appsCheck device policies, or install for another user with --user

How Do You Fix INSTALL_FAILED_UPDATE_INCOMPATIBLE?

INSTALL_FAILED_UPDATE_INCOMPATIBLE means the app that was installed and the new APK are signed with different keys (very common when going from a Play Store build to a local debug build). Android will not replace an app with one that is signed with a different key.

Simply uninstall the installed copy with adb uninstall com.example.app and reinstall. Add -k to the uninstall command if you want to keep the data and cache directories.

How Do You Fix INSTALL_FAILED_VERSION_DOWNGRADE?

INSTALL_FAILED_VERSION_DOWNGRADE means the APK has a lower version code than the app that's already installed. You can force the downgrade with adb install -d old-build.apk (this will preserve data).

On production phones -d only works for debuggable builds. For a release build you'd have to uninstall first (this will reset the app data) and you must note that in the bug report.

The SERVE Checklist Before Every adb install

The SERVE checklist picks up the five reasons why most sideloads fail prior to you even running the command.

  • S - Serial specified. More than one device listed by adb devices? Use -s <serial>.
  • E - existing build checked. Is the app already installed and was it signed with the same key? If not, plan an uninstall.
  • R - Right ABI and Android version. Does the APK contain native code for the device's CPU and is the device at least meeting the minSdk?
  • V - Variant matches flags. Test-only build requires -t; older debug build requires -d; very old devices will require -r for a repeat install.
  • E - Evidence captured. Keep the Success line or the full Failure [...] text with the build number so a failed install becomes a useful bug report.

Can You Run an adb install on Cloud Real Devices?

A local ADB install only works with devices and emulators that are connected to your machine. TestMu AI real devices won't attach to your local ADB, so you install builds on them by uploading the app.

From the dashboard: Real Device > App Testing. Choose Android, upload your app from your system or a public URL, select a device and click Start (Real Device App Testing docs). The Real Device Cloud page lists .apk, .aab and .ipa uploads as well as any installs from the app store.

From CI: upload via the App Testing API (App Testing APIs) using HTTP Basic auth with your username and access key:

#!/usr/bin/env bash
# upload.sh: upload an APK to TestMu AI real devices. Usage: ./upload.sh path/to/app.apk [app-name]
set -euo pipefail

: "${LT_USERNAME:?Set LT_USERNAME}"
: "${LT_ACCESS_KEY:?Set LT_ACCESS_KEY}"
APK="${1:?usage: upload.sh path/to/app.apk [app-name]}"
[ -f "$APK" ] || { echo "No such file: $APK"; exit 2; }
APP_NAME="${2:-$(basename "$APK" .apk)}"

curl --fail -sS -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" \
  -F "appFile=@${APK}" \
  -F "name=${APP_NAME}" \
  -F "visibility=team"

The response contains the app URL in the form lt://APP123456789123456789. Store that as LT_APP_URL and pass it in as the app capability (within LT:Options with isRealMobile set to boolean true) in your Appium tests on real devices.

The API docs show .apk and .ipa for that endpoint. --fail makes curl exit non-zero on an HTTP error so your CI step will visibly fail.

upload.sh uploading an APK to TestMu AI real devices and returning an lt:// app_url, then dumpsys on a real Galaxy S26 running Android 16 showing the uploaded build installed

During a live session, the ADB Shell icon on the session toolbar will run a supported set of shell commands on the device (am start, pm clear and dumpsys on public devices, more on private devices - ADB Shell docs, updated 2 Dec 2026). Installing new builds as ever still goes through the upload flow.

Real device app testing requires the Real Device Plus Live plan or an Enterprise plan (it's not part of the free plan according to the docs).

Note

Note: Need the same build across loads of phones? Upload it once and then open it up on real Android and iOS devices using TestMu AI live app testing on real devices. Start free.

Watch: Upload an App and Test It on a Real Device

For a quick visual walkthrough of this concept, watch the video below from TestMu AI.

This TestMu AI walk-through shows you uploading and managing apps, device logs and ADB shell commands within a real device session. It was recorded prior to the LambdaTest to TestMu AI rebrand; the process is exactly the same.

Youtube thumbnail

Subscribe to the TestMu AI YouTube channel for more tutorials on testing and automation.

What Should You Do After the App Has Been Installed?

Installing is step one. The useful evidence comes next.

Get the logs as you reproduce the bug with adb logcat and use scrcpy for mirroring the screen for a demo or recording. For one-liners to other adb commands, see our adb commands list.

Note

Note: Testing on more devices than you own? Run your build on real Android phones in the browser with device logs and network logs on TestMu AI Real Device Cloud. Start free.

Conclusion

Start with adb devices and a plain adb install app.apk, then add only the flags the build needs: -s when several devices are attached, -d for an older debug build and -g when the permission prompts are not under test. Run the SERVE checklist before each install, and keep the Success or Failure line with the build number for the bug report. When you run out of phones, upload the same APK with upload.sh and run it on real devices in the cloud.

Testing Android apps on phones you don't own? TestMu AI's Real Device Cloud runs live and automated sessions on 50,000+ real iOS and Android devices, with device logs, network logs and video for every session.

To run your first test, start free, or
for a full walkthrough of the product.

Was this helpful?

Authors

Navin Chandra

Navin Chandra

Author · 9 posts

Navin Chandra is a Member of Technical Staff at TestMu AI, building the open-source automation that powers its Selenium and Appium cloud grid. A committer to both Selenium and Appium, he implemented WebDriver BiDi support in Selenium for real-time browser events and bidirectional control and is developing Apple's iOS RemoteXPC protocol in Appium to enable low-level wireless communication with iOS system services. He contributes to Selenium across multiple language bindings as a member of the Selenium GitHub organization. He has served as a Google Summer of Code mentee and mentor at openSUSE and an LFX mentee at CNCF's KubeArmor, and is a SUSE Certified Deployment Specialist. Navin holds a B.Tech in Computer Science.

Srinivasan Sekar

Srinivasan Sekar

Reviewer

Srinivasan Sekar is Director of Engineering at TestMu AI, where he leads engineering and open-source initiatives behind the Selenium and Appium automation grid and owns TestMu AI's MCP Server. A committer to Appium and a contributor to Selenium, WebdriverIO, Taiko, and AppiumTestDistribution, he brings over 15 years of experience in quality engineering and open-source technologies. He is the author of the Apress book 'The MCP Standard: A Developer's Guide to Building Universal AI Tools with the Model Context Protocol,' a Certified Kubernetes and Cloud Native Associate, and an international conference speaker. Before TestMu AI he spent over eight years at Thoughtworks as a Principal Consultant and Quality Architect. Srinivasan holds a B.Tech in Information Technology from Anna University.

adb install APK FAQs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests