Skip to content

Published · Updated

adb install APK: install an app from your computer ​

In short: To adb install an APK, run adb install app.apk with USB debugging on; adb copies the APK file from your computer to the connected Android phone and installs it. Add -r to replace an installed app and keep its data, -d to allow an older version and -g to grant its permissions. Split APKs go in one adb install-multiple command.

The APK file stays on your computer; the adb install command copies it over and installs it in one step, with no prompts on most phones. USB debugging has to be enabled, and the phone listed as device by adb devices: if it shows nothing, unauthorized or offline, that page has the fix. New to adb? Set it up on Windows, macOS or Linux first, then come back. Over Wi-Fi it works the same once the phone is connected with wireless debugging.

Syntax ​

bash
adb install [-r] [-d] [-g] [-t] path/to/app.apk
adb install-multiple base.apk split_config.arm64_v8a.apk
OptionWhat it does
-rReplaces the app if it is already installed and keeps its data
-dAllows an older version than the one installed (apps built as debuggable)
-gGrants every runtime permission the app asks for, so no permission prompts appear
-tAllows a test APK, such as the ones Android Studio builds when you press Run
install-multipleInstalls the APKs of one app split by an app bundle, the base APK first

With an .aab app bundle, Google's bundletool builds the right APKs for a connected phone and installs them (bundletool install-apks).

Split APKs, APKS and XAPK files ​

An app installed from an app bundle arrives as several APK files: a base APK and splits for the processor, screen density and language. adb installs them together, in one command, or Android refuses the incomplete app:

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

An .apks file is a ZIP of such splits made by bundletool; install it with bundletool install-apks --apks=app.apks. An .xapk file is a ZIP made by some download sites: unzip it, run adb install-multiple on all its APK files, and if it holds an Android/obb folder, copy that with adb push Android/obb/com.example.app /sdcard/Android/obb/.

Force an install, and what cannot be forced ​

Most refusals have a flag that allows them:

The install stops becauseAllow it with
The app is already installed-r (keeps the app's data)
The APK is an older version-d, for apps built as debuggable
The APK is a test build-t
Permission prompts would appear later-g

So adb install -r -d -t -g app.apk gets past all four. Some checks no flag can override, because they protect the phone and the app's data: a different signing key than the installed app (uninstall it first, and its data goes with it), an Android version older than the app's minimum, native code for another processor, and a phone policy that blocks installs from USB. The table of errors below has the fix for each.

Behind adb install is Android's package manager: the same install runs inside adb shell as pm install, on an APK that is already on the phone, for example adb shell pm install -r /data/local/tmp/app.apk.

Examples ​

bash
# Install, or update an installed app and keep its data
adb install -r app-release.apk

# A build with a lower version code than the installed one
adb install -r -d app-debug.apk

# Skip every permission prompt, handy before an automated test
adb install -g app.apk

# One phone when several are connected (serial numbers come from adb devices)
adb -s R58M12345 install -r app.apk

On Windows, give paths with spaces in quotes: adb install "C:\Builds\My App.apk".

On many phones at once ​

adb installs on one phone per command. To install on every connected phone, loop over the ones adb devices lists as ready:

bash
for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
  adb -s "$s" install -r app.apk
done
powershell
adb devices | Select-Object -Skip 1 | ForEach-Object {
  $serial, $state = $_ -split '\s+'
  if ($state -eq 'device') { adb -s $serial install -r app.apk }
}

The loop installs on one phone after another. In bash, ending the adb line with & and adding wait after done installs on all of them at the same time.

In BenchFleet you do not need the loop: the phone page installs and removes apps on one phone on every plan, and on Pro, group actions install an app on a group of phones or every phone at once, with the result for each phone. Android app testing on real devices shows what comes after the install: a test on every phone.

Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from $16 a month + VAT (including 300 cloud phone minutes every month).

Common errors and fixes ​

ErrorWhat it meansFix
INSTALL_FAILED_UPDATE_INCOMPATIBLEThe installed app is signed with a different key, for example the Play Store version and your debug buildUninstall the installed app first; its data is lost
INSTALL_FAILED_VERSION_DOWNGRADEThe APK's version code is lower than the installed app'sAdd -d for a debuggable build, or uninstall first
INSTALL_FAILED_ALREADY_EXISTSThe app is installed and the install did not ask to replace itAdd -r
INSTALL_FAILED_TEST_ONLYThe APK is marked as a test buildAdd -t
INSTALL_FAILED_INSUFFICIENT_STORAGEThe phone is short of spaceFree up storage on the phone
INSTALL_FAILED_NO_MATCHING_ABISThe APK's native code is for another kind of processorInstall the build for the phone's processor, or a universal APK
INSTALL_FAILED_OLDER_SDKThe app needs a newer Android version than the phone hasUse a phone with a newer Android version
INSTALL_PARSE_FAILED_NO_CERTIFICATESThe APK is not signedSign it, for example with apksigner
INSTALL_FAILED_USER_RESTRICTEDThe phone blocked the install; some makers' phones ask for confirmation or need Install via USB turned on in Developer optionsAccept the prompt on the phone, or turn that switch on
adb: more than one device/emulatorSeveral phones are connectedChoose one with -s and its serial number
no devices/emulators foundadb sees no phoneSee adb devices

Questions ​

What does adb install do?

It copies an APK file from your computer to the phone and asks Android's package manager to install it, as tapping the APK on the phone would, but without any prompts on most phones. It prints Success when the app is installed.

Where does adb install look for the APK?

On your computer, relative to the folder your terminal is in, so either change to the folder with the APK or give its full path. The APK does not need to be on the phone first.

How do I install an APK without a cable?

Connect over Wi-Fi first. On Android 11 and newer, pair the phone with adb pair and connect with adb connect, then run adb install as usual.

Can adb install an app from Google Play?

No. adb installs APK files you have on your computer. Apps from Google Play are installed by the Play Store app on the phone.

How do I force an APK to install with adb?

Combine the flags for the check that stops it, such as adb install -r -d -t -g app.apk to replace the app, allow an older debuggable build, allow a test APK and grant its permissions. A different signing key, a too-old Android version or the wrong processor type cannot be forced; uninstall the old app, or build an APK that fits the phone.

How do I install an XAPK with adb?

An XAPK is a ZIP file made by some download sites, holding an app's split APKs and sometimes OBB data. Unzip it, install all its APK files in one adb install-multiple command, and copy any OBB folder to /sdcard/Android/obb/ with adb push.

How do I install the same app on many phones?

Run adb install once per phone with -s and each serial number, or loop over adb devices as shown on this page. BenchFleet's group actions install an app on a group of phones or every phone at once on Pro.

Start with the Free plan

Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from $16 a month + VAT (including 300 cloud phone minutes every month).