How to Inspect OTA Background App Compilation on Android Using ADB dumpsys ota_dexopt

On early Android versions, installing a major system firmware update meant waiting through a prolonged, frustrating reboot process accompanied by a modal screen stating “Android is upgrading – Optimizing app X of Y.” During this phase, the Android Runtime (ART) compiled Dalvik Executable (DEX) bytecode into native machine code. To eliminate this post-update downtime, modern Android releases implement seamless background A/B (seamless) updates powered by the OtaDexoptService. While the updated operating system is being written to the inactive disk slot, this service pre-compiles installed applications in the background before the system reboots. This article explains how to inspect OTA background DEX optimization jobs, compilation filters, and execution metrics on Android using adb shell dumpsys ota_dexopt.

Understanding Android OTA DEX Optimization Architecture

Android utilizes a multi-tier execution model combining JIT (Just-In-Time) compilation, AOT (Ahead-Of-Time) compilation, and Cloud/Baseline Profiles. When a system OTA update is delivered to an Android device:

  • A/B Partitioning: The new system update is installed onto the secondary, inactive partition slot (for example, moving from Slot A to Slot B) while the user continues using the phone on Slot A.
  • Background Pre-compilation: The system invokes OtaDexoptService, which iterates through all installed user and system applications, compiling their DEX bytecode against the new framework boot image residing on the updated partition slot.
  • ART Compilation Filters: To conserve storage space and battery during OTA optimization, ART applies selective compilation filters (such as speed-profile or verify) rather than compiling every single line of code with the heavy speed filter.
  • Instantaneous Reboot: When the user finally restarts the device to apply the update, the phone reboots in under 30 seconds into the pre-compiled slot without displaying any app optimization delays.

Connecting to ADB and Querying dumpsys ota_dexopt

To inspect OTA compilation telemetry, connect your Android device via USB or Wi-Fi debugging, confirm authorization with adb devices, and execute the service dump:

adb shell dumpsys ota_dexopt

To save the output for diagnostic review or system benchmarking, pipe the output into a text file:

adb shell dumpsys ota_dexopt > ota_dexopt_diagnostics.txt

If the device uses legacy non-A/B partitioning or has never received an OTA update session, the command reports that no active or historical OTA compilation jobs are recorded.

Inspecting OTA DEX Compilation Job State and Progress

Examine the overall job status section at the top of the dump output:

adb shell dumpsys ota_dexopt | grep -A 10 "OTA Dexopt Service:"

Review the primary operational indicators:

  • mComplete: A boolean flag indicating whether the background compilation cycle for the pending update finished successfully.
  • mImportantPackagesTotal & mOtherPackagesTotal: Reports the total count of applications queued for optimization, divided into critical priority apps (frequently used apps and system daemons) and secondary background apps.
  • mOptimizedPackages: The count of packages that have completed Ahead-Of-Time compilation.
  • mSkippedPackages: Packages that were bypassed (for example, applications that already contain valid pre-compiled ODEX artifacts or applications explicitly configured for interpreter execution).

Auditing Compilation Filters and Storage Allocation

The dump details which compilation compiler filter was applied to target packages during the update pass:

adb shell dumpsys ota_dexopt | grep -A 15 "Compilation Details:"

Understanding the standard ART compiler filters clarifies the trade-offs between compilation speed and runtime performance:

  • verify: Verifies DEX bytecode integrity without generating native machine code, minimizing storage consumption and background battery drain.
  • quicken: Optimizes simple bytecode instructions and performs minimal method inlining.
  • speed-profile: Uses cloud and local execution profiles to compile only the frequently executed “hot” methods of an application, achieving high performance with moderate storage usage.
  • speed: Compiles all application methods into native code Ahead-Of-Time. While providing maximum runtime execution speed, it requires significant compilation time and storage space.

Monitoring OTA Compilation Durations and Failures

To evaluate update efficiency and diagnose why an update took longer than expected to complete, inspect the time accounting table:

adb shell dumpsys ota_dexopt | grep -i "duration"

This section reports total elapsed compilation time, per-package optimization durations, and thermal throttling pauses (where the device suspended compilation to prevent CPU overheating while charging).

Inspecting Package DEX Status via pm Command

To cross-reference the OTA optimization status of an individual package (for example, verifying whether Chrome or a critical enterprise app is compiled with native code), query the package manager directly via ADB:

adb shell dumpsys package com.android.chrome | grep -A 8 "dexopt"

The output reports the active compilation filter, instruction set architecture (e.g. arm64), and paths to compiled .odex and .vdex artifacts.

By reviewing adb shell dumpsys ota_dexopt, Android engineers and device integrators can verify that background compilation works seamlessly, preventing battery drain and ensuring fast, smooth firmware updates.

Get the best tech tips delivered straight to your inbox.

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