adb Verified current stable Not installed? Programming

Adb / Push Package To Specific Device

Push Package To Specific Device

Installs an APK file onto a specified device using its serial number.

$
Terminal
adb -s <serial_number> install <path/to/file>.apk

When To Use

During device provisioning when targeting a specific unit.

Pro Tip

Use the '-g' flag along with this command to grant all runtime permissions upon installation, but beware of potential security implications.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
adb -s <serial_number> install <path/to/file>.apk

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Performing Streamed Install
Success

Anatomy of Output

Understanding the result

Success Installation Status

Indicates whether the APK was successfully installed.

Performing Streamed Install Installation Method

The method used to install the APK, suggesting a direct streaming to device.

1 file pushed, 0 skipped File Transfer Summary

Shows the count of files transferred and skipped during the install.

Troubleshooting

Common pitfalls

adb: failed to install /path/to/file.apk: Failure [INSTALL_FAILED_INVALID_APK]

Solution: Confirm APK format and restart the ADB daemon.

adb: failed to install /path/to/file.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS]

Solution: Ensure the APK is compatible with the device's CPU architecture.

adb: error: more than one device/emulator

Solution: Specify a correct serial number or ensure only one device is connected.

Command Breakdown

What each part is doing

adb
Base Command
The executable that performs this operation. Here it runs Adb before the shell applies any redirect operators.
<serial_number>
serial number
The value supplied for serial number.
<path/to/file>
Input Files
The file path or paths supplied to this command.
-s
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run: adb -s SERIAL_NUMBER install path/to/file.apk

  2. Step 2

    Confirm successful installation with: adb -s SERIAL_NUMBER shell pm list packages | grep PACKAGE_NAME

  3. Step 3

    Check the output for your package in the list.

Alternative Approaches

Comparable commands in other tools

Alternative programming tools for the same job.