How to Install APK via ADB: Complete Command Reference for Android 2026
Master ADB APK installation on Android. Learn adb install, adb uninstall, force install, downgrade, keep data, and debug installation errors with this complete terminal reference.
How to Install APK via ADB: Complete Command Reference for Android 2026
ADB (Android Debug Bridge) is the most powerful tool for Android power users. When the on-screen installer fails, ADB can almost always get the job done.
ADB is a command-line tool that lets you communicate with your Android device from a computer. While it's primarily used by developers for debugging, it's also incredibly useful for advanced users who want more control over APK installation.
This guide covers every ADB command you need to install, uninstall, and manage APK files — with real examples and troubleshooting tips.
What You'll Need
Step 1: Enable Developer Options on Your Phone
Settings → About Phone →
→ Tap "Build Number" 7 times
→ You'll see "You are now a developer!"Step 2: Enable USB Debugging
Settings → System → Developer Options →
→ Toggle ON "USB Debugging"
→ Toggle ON "Install via USB" (on some phones)
→ Confirm the security promptStep 3: Install ADB on Your Computer
Windows:
1. Download Platform Tools from developer.android.com
2. Extract to C:adb
3. Add C:adb to your system PATH
4. Open Command Prompt or PowerShellmacOS:
# Using Homebrew (easiest):
brew install android-platform-tools
# Manual download:
# Download from developer.android.com and extract to ~/adbLinux:
# Debian/Ubuntu:
sudo apt install adb
# Fedora/RHEL:
sudo dnf install android-tools
# Arch Linux:
sudo pacman -S android-toolsStep 4: Connect Your Phone and Verify
# Connect phone via USB cable
# On phone, accept the "Allow USB debugging?" prompt
# Verify connection:
adb devices
# Expected output:
List of devices attached
XXXXXXXXXXXX device
# If it says "unauthorized", check your phone and accept the promptADB Install Commands: Complete Reference
Basic Commands
| Command | Description | Use Case |
|---|---|---|
adb install app.apk | Install an APK normally | Basic first-time installation |
adb install -r app.apk | Reinstall/update, keep app data | Updating an app without losing data |
adb install -r -d app.apk | Install and allow downgrade | Downgrading to an older version |
adb install -s app.apk | Install to SD card | Installing large apps on external storage |
adb install --abi arm64-v8a app.apk | Install for specific ABI | Installing architecture-specific APKs |
adb install-multiple app1.apk app2.apk | Install split APKs together | Installing bundles with multiple APK files |
Advanced Install Options
| Flag | Full Name | What It Does |
|---|---|---|
-r | Reinstall | Reinstall existing app, keeping its data |
-d | Downgrade | Allow version code downgrade (must use with -r) |
-s | SD card | Install on shared mass storage (SD card) |
-f | Force | Force install on internal storage |
-t | Test APK | Allow installation of a test APK |
-g | Grant all | Grant all runtime permissions during install |
--instant | Instant app | Install as an instant app |
--abi | ABI override | Override platform ABI for native code |
--no-streaming | No streaming | Force ADB to push file before installing |
Real-World Examples
Example 1: Basic APK Installation
# Navigate to the folder containing your APK
cd ~/Downloads
# Install an APK
adb install com.whatsapp.apk
# Success output:
Performing Streamed Install
SuccessExample 2: Update an App Without Losing Data
# Update WhatsApp while keeping chat history
adb install -r com.whatsapp.apk
# The -r flag preserves app data (login, messages, etc.)Example 3: Downgrade to an Older Version
# If a new version causes problems, go back to an older one
adb install -r -d com.whatsapp_old.apk
# -d allows downgrade to a lower version code
# Must always be used with -rExample 4: Install Split APKs (App Bundle)
# Modern apps use split APKs. Install them together:
adb install-multiple base.apk config.arm64_v8a.apk config.en.apk
# Or with a wildcard (in some shells):
adb install-multiple *.apkExample 5: Install to SD Card
# For large games, install to external storage
adb install -s com.heavygame.apk
# Note: Not all apps support moving to SD cardExample 6: Grant All Permissions Automatically
# Skip the permission prompts (useful for testing)
adb install -g app.apk
# All runtime permissions are granted automatically
# Works on Android 6.0+ devicesUninstall Commands
| Command | Description |
|---|---|
adb uninstall com.example.app | Uninstall an app by package name |
adb uninstall -k com.example.app | Uninstall but keep app data and cache |
adb shell pm list packages | List all installed packages to find package names |
adb shell pm list packages | grep whatsapp | Search for a specific package |
Debugging Installation Errors
When ADB install fails, it provides detailed error messages. Here's how to interpret and fix them:
| Error Message | Meaning | Solution |
|---|---|---|
INSTALL_FAILED_ALREADY_EXISTS | App already installed | Use -r flag to reinstall |
INSTALL_FAILED_VERSION_DOWNGRADE | Newer version already installed | Add -d flag to allow downgrade |
INSTALL_FAILED_INVALID_APK | APK file is corrupted or invalid | Re-download the APK from gptoapk.com |
INSTALL_FAILED_NO_MATCHING_ABIS | CPU architecture mismatch | Download correct ABI version of the APK |
INSTALL_FAILED_UPDATE_INCOMPATIBLE | Signature mismatch | Uninstall existing app first |
INSTALL_FAILED_INSUFFICIENT_STORAGE | Not enough space | Free up storage on your device |
INSTALL_FAILED_DEXOPT | DEX optimization failed | Reboot device and try again |
Error: device not found | Phone not connected properly | Check USB cable, driver, and USB debugging |
Error: unauthorized | USB debugging not approved | Check phone and tap "Allow" |
Useful ADB Commands Beyond Installation
ADB can do much more than just install APKs. Here are some commands that complement APK installation:
File Management
# Push a file to your phone
adb push file.apk /sdcard/Download/
# Pull a file from your phone
adb pull /sdcard/Download/file.apk .
# List files in a directory
adb shell ls /sdcard/Download/Package Manager (pm) Commands
# List all installed packages
adb shell pm list packages
# List only third-party apps (not system)
adb shell pm list packages -3
# Find a specific package
adb shell pm list packages | grep facebook
# Clear app data
adb shell pm clear com.example.app
# Disable an app (hide from launcher)
adb shell pm disable-user --user 0 com.example.app
# Enable a disabled app
adb shell pm enable com.example.appDevice Information
# Get device model
adb shell getprop ro.product.model
# Get Android version
adb shell getprop ro.build.version.release
# Get API level
adb shell getprop ro.build.version.sdk
# Get CPU architecture
adb shell getprop ro.product.cpu.abi
# Screen resolution
adb shell wm size
# Battery status
adb shell dumpsys batteryWi-Fi ADB (Wireless Installation)
Starting with Android 11 (API 30), you can use ADB wirelessly without a USB cable.
Method 1: Android 11+ (Developer Options)
1. Connect phone and computer to same Wi-Fi network
2. On phone: Settings → Developer Options →
→ Wireless Debugging → Enable
3. Pair using QR code or pairing code:
adb pair 192.168.1.100:38399
4. Connect:
adb connect 192.168.1.100:37251Method 2: Traditional TCP/IP (Android 10 and below)
1. Connect phone via USB first
2. Set ADB to TCP mode:
adb tcpip 5555
3. Disconnect USB
4. Connect over Wi-Fi:
adb connect 192.168.1.100:5555
5. Verify:
adb devices
→ 192.168.1.100:5555 devicePro tip: Wi-Fi ADB is slower for large APK files (over 100MB). For big files, stick with USB.
# Disconnect wireless ADB when done:
adb disconnect 192.168.1.100:5555
# Or disconnect all:
adb disconnectAutomation: Install Multiple APKs with a Script
If you frequently install multiple APKs, create a simple script:
Bash script (macOS/Linux):
#!/bin/bash
# batch-install.sh — Install all APKs in current folder
echo "Checking for connected devices..."
adb devices
for apk in *.apk; do
echo "Installing $apk..."
adb install -r "$apk"
if [ $? -eq 0 ]; then
echo "✅ $apk installed successfully"
else
echo "❌ Failed to install $apk"
fi
done
echo "Batch installation complete!"PowerShell script (Windows):
# batch-install.ps1
Get-ChildItem -Filter *.apk | ForEach-Object {
Write-Host "Installing $($_.Name)..."
adb install -r $_.Name
}Security Considerations
ADB is a powerful tool. Here's how to use it safely:
- Disable USB Debugging when not in use — Leaving it enabled increases attack surface if your phone is lost or stolen
- Only accept ADB prompts from trusted computers — The "Allow USB debugging?" dialog shows the computer's RSA key fingerprint
- Use ADB over USB rather than Wi-Fi when possible — Wireless ADB is convenient but slightly less secure
- Revoke USB debugging authorizations regularly
Settings → Developer Options →
→ Revoke USB Debugging Authorizations
→ This clears all trusted computer associationsQuick Command Reference Card
================= ADB INSTALL CHEAT SHEET =================
INSTALLING
adb install app.apk Basic install
adb install -r app.apk Reinstall, keep data
adb install -r -d app.apk Downgrade install
adb install -s app.apk Install to SD card
adb install -g app.apk Grant all permissions
adb install-multiple *.apk Install split APKs
UNINSTALLING
adb uninstall com.example.app Uninstall app
adb uninstall -k com.example.app Uninstall, keep data
TROUBLESHOOTING
adb devices List connected devices
adb kill-server Restart ADB server
adb start-server Start ADB server
adb reboot Reboot device
adb logcat View device logs
PACKAGE INFO
adb shell pm list packages -3 User-installed apps
adb shell pm path com.example.app APK path on device
adb shell pm clear com.example.app Clear app data
adb shell dumpsys package com.example App details
WIRELESS
adb tcpip 5555 Enable TCP mode
adb connect IP:5555 Connect wirelessly
adb disconnect Disconnect
FILE TRANSFER
adb push file.apk /sdcard/ Copy to device
adb pull /sdcard/file.apk . Copy from device*Last updated: June 2, 2026. ADB commands are consistent across Android versions. Check developer.android.com for the latest additions.*
Related guides:
- APK Installation Error Codes: Complete Reference
- How to Fix APK Signature Verification Failed
- Best Free APK Download Sites 2026
Keywords: ADB, ADB install, ADB commands, sideload APK, Android debugging, terminal, adb install apk, ADB guide, Android Debug Bridge, gptoapk