adb shell list installed packages

Android Packages: List Installed via ADB Shell

By John Martin
AD

Managing applications on Android often requires looking beyond the simple app drawer interface, and the command line provides a powerful way to interact with the operating system. The adb shell list installed packages command is a fundamental tool for developers and power users who need to see every application sitting on a device. This approach offers a precise view of the software landscape that the graphical settings menu might obscure or make cumbersome to navigate. By leveraging the Android Debug Bridge, you can quickly audit your device or emulator for troubleshooting and optimization purposes.

When you run this command, you are essentially querying the package manager service that Android uses to keep track of every APK and its associated data. This process reveals not just the user-facing apps but also system-level components and background services that are essential for the device to function. Understanding how to filter and interpret this list is crucial for managing storage, identifying bloatware, or preparing an app for specific testing scenarios. It transforms your view of the device from a consumer perspective to a managerial one.

Understanding ADB and Package Listing

ADB, or Android Debug Bridge, serves as a versatile command-line tool that facilitates communication with a device running the Android operating system. It acts as a bridge between your development machine and the Android runtime, allowing you to execute shell commands, transfer files, and manage the system state. The ability to list packages is one of its most basic yet essential functions, providing a raw inventory of the software environment.

AD
Client Challenge
Client Challenge
the document is in full view and contains information for each item, including instructions to use it
the document is in full view and contains information for each item, including instructions to use it
the party packages are pink and white
the party packages are pink and white

The syntax for this operation is straightforward, typically involving the `adb shell pm list packages` variation, where `pm` stands for package manager. This command queries the system database and returns a list of identifiers for every installed application. These identifiers usually follow the format `package:com.example.app`, which is the unique name assigned to the application by its developer. Grasping this structure is the first step toward mastering more complex queries and filters.

Setting Up the Environment

Before you can execute any adb commands, you must ensure that the Android SDK Platform-Tools are installed on your computer. These tools contain the necessary binaries for adb to communicate with your device over a USB connection or network. You also need to enable Developer Options and USB Debugging on the Android device itself to allow the connection to proceed securely.

there are many shells laid out on the table
there are many shells laid out on the table
the list of shell sizes for different types of shells
the list of shell sizes for different types of shells
List of 331 shell companies delisted from stock exchanges - The Indian Wire
List of 331 shell companies delisted from stock exchanges - The Indian Wire

Once the device is connected and recognized—usually verified by running `adb devices`—you can confidently run the package listing command. The terminal or command prompt will then display the list of packages line by line. This direct interaction is significantly faster than scrolling through menus, especially when dealing with devices that have hundreds of applications installed.

Interpreting the Output Format

The default output of the command presents each package on a new line, prefixed with the string `package:`. This prefix is a clear indicator that the following text is a unique system identifier rather than a display name. For example, you will see entries like `package:com.google.android.youtube` or `package:com.samsung.android.app.notes`.

AD

It is important to distinguish between the package name and the app name. The package name is immutable and used internally by the system to reference the application, while the app name is the human-readable label you see on the home screen. If you are looking to uninstall or inspect an app thoroughly, you must rely on the package name to ensure you are targeting the correct component.

adb shell list installed packages
adb shell list installed packages
seashells🌊🐚
seashells🌊🐚
Florida Shells ID Guide – Beginner Friendly
Florida Shells ID Guide – Beginner Friendly
APN Lookup by Address
APN Lookup by Address
Tablas de Vida Marina
Tablas de Vida Marina
an image of shells on the app for shell ids, which shows different types of shells
an image of shells on the app for shell ids, which shows different types of shells

Filtering and Managing the List

When a device has a large number of applications, the raw list can become overwhelming to scan through. Fortunately, the adb shell list installed packages functionality can be enhanced with standard Linux text processing tools. By piping the output to commands like `grep`, you can search for specific applications or vendors instantly without manual scrolling.

This approach is incredibly useful for identifying specific manufacturers' software or filtering out system packages to focus only on user-installed applications. By combining the power of the shell with the raw data from the package manager, you gain a level of control that is simply not possible through the standard Settings app.

AD

Using Grep for Specific Searches

Grep is a powerful command-line utility for searching text using patterns. If you are looking for every package associated with a specific company, such as Samsung or Google, you can use a command like `adb shell pm list packages | grep samsung`. This filters the output to show only lines containing the specified keyword, making it much easier to audit related software.

an image of different seashells on black background
an image of different seashells on black background
an orange and white email box with the text return code and label on it,
an orange and white email box with the text return code and label on it,
two display cases filled with shells and other items
two display cases filled with shells and other items
Create a Packing List [Free Template] - IncoDocs
Create a Packing List [Free Template] - IncoDocs
an orange and white cell phone with the text return code and label on it's screen
an orange and white cell phone with the text return code and label on it's screen
seashells 🐚
seashells 🐚
Shell Collection 🐚🦪
Shell Collection 🐚🦪
a document with an image of the company's logo on it
a document with an image of the company's logo on it
the basic format for a resume is shown in this file, and it contains several different types
the basic format for a resume is shown in this file, and it contains several different types
The company owns the building. But who owns the company? PART 2 👀
The company owns the building. But who owns the company? PART 2 👀
the instructions for how to print and label labels on an iphone or ipad device, with text below
the instructions for how to print and label labels on an iphone or ipad device, with text below
an invoice form with the number and date listed for each item on it
an invoice form with the number and date listed for each item on it
the beach is covered in shells as the sun sets
the beach is covered in shells as the sun sets

You can also use this technique to find potentially unwanted applications or to verify if a specific service is installed. For instance, searching for `com.android.vending` confirms the presence of the Google Play Store, while searching for `com.facebook` can help you quickly locate the main application and its associated background services.

Filtering Out System Applications

Android devices carry a mix of user apps and system apps. System apps are pre-installed by the manufacturer and are often necessary for the core functionality of the device; however, some users may wish to disable or remove them to free up resources. The command `adb shell pm list packages -s` specifically lists the system packages, separating them from user apps.

AD

Conversely, if you are only interested in the apps the user has installed, you can use the `-u` flag with the `dumpsys package` command or leverage the `-3` flag with `pm list`. This distinction is vital for developers who need to understand the difference between the baseline operating system and the additional software added by the end-user or enterprise management tools.

Advanced Usage and Common Scenarios

Beyond simple listing, the package manager shell commands can be combined to perform complex audits. You might want to check the version of a specific app or verify if a debuggable build is installed. By using `dumpsys package` in conjunction with the package name, you can extract detailed metadata, including version codes, permissions, and installation paths.

This level of detail is essential for regression testing or when ensuring compliance with specific security policies. Being able to script these checks means you can automate the verification of app configurations across multiple devices, ensuring consistency in development or quality assurance environments without manual intervention.

Checking Version and Installation Details

To retrieve the version information of a specific app, you can query the package manager with a command that extracts the `versionName` and `versionCode`. This is helpful when confirming that a specific beta version has been installed correctly or when verifying that an old, vulnerable version has been successfully updated. The command essentially pulls the manifest data directly from the installed APK.

Knowing the exact installation path is also useful for advanced users who need to pull files directly from the device or verify the source of an application. The ability to map a package name to its `/data/app` or `/system/app` location provides transparency into how the device manages its software filesystem.

Scripting and Automation

For IT administrators or developers managing fleets of devices, running these commands manually is not feasible. By writing shell scripts or incorporating adb commands into CI/CD pipelines, you can automate the process of checking for installed applications. This ensures that every device in a testing pool matches the expected configuration before tests are run.

Automation scripts can log the output, compare it against a whitelist or blacklist, and even trigger alerts if unauthorized software is detected. This transforms the simple act of listing packages into a powerful monitoring and security tool that scales efficiently across many devices.

Mastering the adb shell list installed packages command opens a door to deeper control over your Android device, allowing you to move beyond simple interactions and manage software with precision. Whether you are a developer verifying test builds or a user cleaning up unwanted bloatware, this command provides the clarity and efficiency needed to maintain your device effectively. As you integrate these techniques into your workflow, you will find that managing Android software becomes significantly more intuitive and efficient.

AD