Find Path One liner

The command:

adb shell "pm path "$(adb shell "pm list packages | grep google" | awk -F: '{print $2}')

In short:

  1. List Packages: Finds all installed packages containing "google":

adb shell "pm list packages | grep google"
  1. Extract Package Name: Extracts only the package name from the output:

| awk -F: '{print $2}'
  1. Get APK Path: Retrieves the file path of the APK for the first matching package:

adb shell "pm path <package_name>"
  1. Combining It All: Automatically passes the package name to pm path to get the APK path in one command.

Last updated