How to use ADB to install an Android app with .apk file?

Step 1: Install ADB on your computer

Installing ADB (Android Debug Bridge) on both macOS and Windows involves a few steps. Here’s how you can do it for each operating system:

### Installing ADB on macOS:

  1. Download the Android SDK Platform Tools from the official Android Developer website: SDK Platform Tools release notes  |  Android Studio  |  Android Developers
  2. Extract the downloaded ZIP file.
  3. Open Terminal and navigate to the extracted directory.
  4. You can use ADB directly from this directory or move it to a location in your system PATH for easier access.

### Installing ADB on Windows:

  1. Download the Android SDK Platform Tools from the official Android Developer website: SDK Platform Tools release notes  |  Android Studio  |  Android Developers
  2. Extract the downloaded ZIP file to a location on your computer (e.g., C:\platform-tools).

Step 2: Install the apk with the command “adb install *.apk”

  1. Open Terminal or Command Prompt:
  • On macOS, you can find Terminal in the Applications folder or by using Spotlight search.
  • On Windows, you can search for Command Prompt in the Start menu.
  1. Navigate to the ADB Directory:
  • If ADB is not in your system PATH, you may need to navigate to the directory where ADB is located using the cd command. For example:
    cd path_to_adb_directory
  1. Connect Your Android Device:
  • Ensure that your Android device is connected to your computer via USB and that USB debugging is enabled on the device.
  1. Drag the APK File onto the Terminal Window:
  • Input “adb install” and a space in the command line
  • Locate the APK file you want to install in your file explorer.
  • Drag the APK file and drop it onto the Terminal or Command Prompt window. This action will automatically populate the file path in the terminal/command prompt.
  1. Press Enter to Execute the Command:
  • After dragging the APK file, you will see the file path displayed in the terminal or command prompt.
  • Press Enter to execute the command. This will initiate the installation process of the APK file on your connected Android device.

That’s it! You’ve successfully installed an APK file onto your Android device using the ADB toolkit by dragging the file onto the terminal window.