How to Inspect App Hibernation States and Storage Optimisation on Android Using ADB dumpsys app_hibernation

Modern mobile operating systems must proactively manage device resources to protect battery longevity, reclaim internal storage, and enforce privacy boundaries. Introduced in Android 12 and enhanced in subsequent releases, App Hibernation automatically targets applications that have not been opened by the user for an extended period (typically several months). When an application enters hibernation, the Android system server automatically revokes runtime permissions, purges temporary cache files, halts background jobs, and places the package into a dormant state until manually relaunched. Using Android Debug Bridge (ADB), system administrators and Android developers can inspect the App Hibernation subsystem via dumpsys app_hibernation to audit hibernation status, simulate inactivity thresholds, and debug lifecycle transitions.

Architecture of the App Hibernation Subsystem

The App Hibernation framework operates through the collaboration of several core system services within the Android system server:

  • UsageStatsService: Tracks application engagement, foreground runtime, and last-used timestamps. It signals when a package exceeds the inactivity threshold.
  • AppHibernationService: The authoritative coordinator that manages global (device-level) and per-user hibernation states. It maintains persistent state records in /data/system/users/[user_id]/app_hibernation/.
  • PermissionController: Interacts with the hibernation service to automatically reset sensitive runtime permissions (such as location, microphone, and camera) to protect user privacy.
  • StorageManagerService: Purges internal app caches (OAT files, DEX compilation artefacts, and temporary data caches) to recover device storage capacity without deleting user account data or persistent databases.

When a hibernated application is launched by the user, the system seamlessly transitions it out of hibernation, re-establishing base execution tokens while prompting the user to re-grant necessary runtime permissions.

Establishing ADB Communication and Verifying Service Availability

Connect your Android device to your computer via USB or wireless debugging. Launch a terminal session and verify device recognition:

adb devices

Confirm that the target device displays an authorized status. Next, check that app_hibernation is registered in the Android Service Manager:

adb shell service check app_hibernation

The command will confirm: Service app_hibernation: found. Note that App Hibernation is natively present on Android 12 (API level 31) and higher.

Dumping Complete App Hibernation Telemetry

To inspect the entire diagnostic state of the App Hibernation service across all user profiles on the device, invoke dumpsys:

adb shell dumpsys app_hibernation

The resulting output details global hibernation states, per-user package statuses, and storage reclamation metrics:

APP HIBERNATION SERVICE (dumpsys app_hibernation)

User Level Hibernation (User 0):
  Total hibernated packages: 3
  Packages:
    Package: com.example.infrequentgame
      Hibernated: true
      Last modified: 2026-11-01 10:14:22
      Storage saved: 142.8 MB
    Package: com.travel.scannerapp
      Hibernated: true
      Last modified: 2026-10-15 08:30:10
      Storage saved: 86.4 MB
    Package: com.retail.loyaltycard
      Hibernated: true
      Last modified: 2026-10-28 14:02:50
      Storage saved: 34.1 MB

Global Level Hibernation:
  Total globally hibernated packages: 1
  Packages:
    Package: com.example.infrequentgame
      Hibernated: true
      DEX opt status: CLEARED

Auditing Hibernation States for a Specific Application

If you are developing or testing an application and need to verify its specific hibernation status without sifting through the full system dump, filter the output using grep:

adb shell dumpsys app_hibernation | grep -A 5 "Package: com.example.targetapp"

You can also use the Android command line utility cmd app_hibernation to query the boolean status directly:

adb shell cmd app_hibernation is-hibernating com.example.targetapp

The shell returns true or false for the current user profile. To query the global, device-wide hibernation status across all multi-user profiles, pass the --global flag:

adb shell cmd app_hibernation is-hibernating --global com.example.targetapp

Simulating and Forcing Hibernation for Testing

Testing an application’s recovery from hibernation normally requires waiting months for system timeouts to trigger. Using ADB, developers can immediately force an application into hibernation to test permission re-acquisition and cache regeneration workflows:

adb shell cmd app_hibernation set-hibernating com.example.targetapp true

Verify that the package was successfully placed into hibernation:

adb shell cmd app_hibernation is-hibernating com.example.targetapp

While hibernated, inspect the package’s permissions via dumpsys package to confirm that runtime permissions have been stripped by the system:

adb shell dumpsys package com.example.targetapp | grep -A 10 "runtime permissions:"

To manually wake the application and reverse the hibernation state via ADB, execute:

adb shell cmd app_hibernation set-hibernating com.example.targetapp false

Configuring Hibernation Settings and Battery Optimisations

In enterprise line-of-business (LOB) apps or background telemetry solutions, automatic hibernation can disrupt scheduled sync tasks. Applications can request that users disable hibernation by presenting the system settings screen for unused apps:

adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:com.example.targetapp

Administrators managing enterprise endpoints can check whether an application is exempted from hibernation by inspecting device policy controller (DPC) exemptions and app-op states:

adb shell cmd appops get com.example.targetapp AUTO_REVOKE_PERMISSIONS_IF_UNUSED

If set to ignore or default: allow, the package remains subject to automated inactivity sweeps. Setting the flag to deny prevents the system from revoking permissions and placing the app into hibernation.

Get the best tech tips delivered straight to your inbox.

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