Introduction
While installing applications from the Google Play Store is the standard and most secure method, developers and power users frequently need to install applications manually. This process, known as sideloading, involves installing an Android Package Kit (APK) file directly. While you can sideload apps by downloading them on the device and tapping them, using the Android Debug Bridge (ADB) from a computer allows for faster bulk installations, downgrading apps, and installing to devices with broken screens. This guide explains how to sideload using ADB.
Prerequisites
You require a computer (Windows, macOS, or Linux) with the Android SDK Platform-Tools installed, a USB cable, and the .apk file you wish to install. You must also have your Android device on hand.
Step 1: Enable Developer Options and USB Debugging
Before ADB can communicate with your device, you must enable USB Debugging.
- Open the Settings app on your Android device.
- Scroll down to About phone (or About device).
- Locate the Build number entry and tap it rapidly seven times. You will see a toast notification stating, “You are now a developer!”
- Go back to the main Settings menu, navigate to System > Developer options.
- Scroll down and toggle USB debugging to the ON position.
Step 2: Connect and Authorize the Device
Connect your Android device to your computer via USB. Open a Command Prompt (Windows) or Terminal (macOS/Linux) on your computer.
Navigate to the directory where you extracted the ADB Platform-Tools, or simply run the following command if ADB is in your system PATH:
adb devices
Look at your Android device’s screen. A prompt will appear asking to “Allow USB debugging” from your computer’s RSA key fingerprint. Check the box to “Always allow from this computer” and tap Allow.
Run adb devices again in your terminal. It should now list your device’s serial number followed by the word device. (If it says unauthorized, the prompt was not accepted).
Step 3: Sideload the APK File
To install the application, use the adb install command followed by the exact path to the APK file on your computer.
adb install "C:\Downloads\myapp_v1.2.apk"
(Note: You can simply type adb install and then drag and drop the APK file into the terminal window to automatically populate the file path).
Press Enter. ADB will stream the APK to the device and install it. If successful, the terminal will output Success.
Step 4: Advanced Installation Flags
ADB provides several flags that are highly useful for specific scenarios:
- Downgrading an App: Android normally blocks installing an older version of an app over a newer version. Use the
-dflag to force a downgrade (Note: this often requires the app to be debuggable).adb install -d "app.apk" - Reinstalling / Overwriting: To reinstall an app while keeping its data intact, use the
-rflag.adb install -r "app.apk" - Grant All Permissions: To automatically grant all runtime permissions (like camera or location) upon installation, use the
-gflag.adb install -g "app.apk"