How to Inspect Staged Package Installation Sessions on Android Using ADB dumpsys package

Modern Android versions rely on the PackageInstaller framework and staged install sessions to manage APK splits, multi-package app bundles, and Mainline APEX system updates. When an application or system component is installed or updated, Android creates an atomic session that stages the payload in secure storage, performs cryptographic and manifest verifications, and applies the update upon device reboot or runtime confirmation. When installations stall, return cryptic error codes, or leave orphaned staged sessions consuming internal storage, Android Debug Bridge (ADB) provides system engineers and developers with direct access to inspect session registries via dumpsys package.

Understanding Android Staged Installer Sessions

Unlike legacy single-file APK installations, modern Android application deliveries often involve multiple split APKs (such as base APK, ABI architecture splits, language resources, and screen density assets) or atomic multi-package rollouts. To coordinate these complex updates safely, Android uses a state-machine session model:

  • Session Creation: The installer client requests a new session ID from PackageInstaller.
  • Payload Staging: Bytes are streamed into temporary staging directories managed by installd.
  • Verification & Seal: The session is sealed, preventing further data modification while the system verifies package certificates, signature schemes, and compatibility.
  • Staged APEX/APK Processing: For reboot-required updates (such as APEX modules), the session is marked as staged and held until boot-time activation.
  • Commit or Abandon: Upon success, packages are activated and old binaries purged. If verification fails or conflicts arise, the session transitions to an error state or is abandoned.

Connecting to ADB and Interrogating Package Sessions

Ensure your Android device has Developer Options and USB Debugging enabled, then connect via terminal:

adb devices

To inspect all active, staged, and historic installer sessions, execute dumpsys package with the sessions filter:

adb shell dumpsys package sessions

The command outputs a comprehensive list of all sessions recorded by the system service. For each session, Android reveals critical diagnostic attributes:

  • Session ID: The unique integer identifying the install transaction.
  • User ID: The target Android user profile (e.g. userId=0 for primary user, work profile IDs for managed users).
  • Installer Package: The package name of the app initiating the installation (e.g., com.android.vending, com.google.android.packageinstaller, or shell).
  • Mode: Full installation (MODE_FULL_INSTALL) or inheritance mode (MODE_INHERIT_EXISTING).
  • Stage Path: The filesystem directory where the payload was written (e.g. /data/app/vmdl...tmp).
  • State: Whether the session is active, sealed, committed, staged, or ready for activation.

Filtering Specific Staged Sessions and APEX Updates

If you are troubleshooting system APEX module updates (such as Project Mainline updates to Conscrypt, Media, or AdServices), query staged sessions specifically:

adb shell dumpsys package --staged-sessions

To inspect whether a staged APEX session is marked as ready for the next reboot, examine the session status block:

adb shell dumpsys package --staged-sessions | grep -E "(SessionID|isStaged|isReady|isApplied|isFailed)"

If an update encountered a verification error during pre-reboot validation, the session output contains explicit failure reasons such as signature mismatch, minimum SDK version violations, or rollback triggers.

Inspecting Raw Session Metadata via cmd package

Alongside dumpsys package, Android provides the interactive cmd package tool to query and interact with active installer sessions directly. To list all active sessions with compact formatting:

adb shell cmd package list-install-sessions

To query detailed parameters for an individual session by its numeric ID:

adb shell cmd package get-install-session 123456789

This command outputs the target package name, installer UID, created timestamp, install location, and staged file progress.

Abandoning Hanging or Orphaned Installer Sessions

During development or testing of split APK installations, a crashed deployment script or disconnected USB cable can leave orphaned sessions in a sealed or staged state, locking package files or consuming disk space. You can force-abandon a stalled session using cmd package:

adb shell cmd package abandon-install-session 123456789

Verify that the session was dismantled and removed from the active registry:

adb shell cmd package list-install-sessions

Monitoring Live Package Installation Events

To troubleshoot intermittent installation failures in real time as an application is being deployed from Android Studio, Google Play, or sideloading, monitor logcat output tagged with PackageInstaller and PackageManager:

adb logcat -s PackageInstaller:V PackageManager:V StagingManager:V

This real-time log stream details session lifecycle transitions, manifest parsing errors, and filesystem write operations, allowing you to resolve staging and installation errors quickly.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.