How to Simulate Battery Level, Charge State, and Temperature on Android (No Root)

16 min read Learn step‑by‑step how to fake battery level, charging status, and temperature on any Android device using ADB, without rooting the phone. October 12, 2026 18:00 How to Simulate Battery Level, Charge State, and Temperature on Android (No Root)

When you develop or test Android apps that react to battery conditions, you quickly discover that waiting for the real battery to drain or charge is impractical. Android provides a hidden ADB interface that lets you override the system‑reported battery level, charge state, and even temperature. This tutorial walks you through the entire process—pre‑flight checks, command syntax, verification, and troubleshooting—so you can reliably simulate any battery scenario without rooting the device.

Why Simulate Battery Conditions?

Many apps change their behavior based on power availability: video players may lower bitrate, location services may pause, or background sync may be deferred. Testing those pathways manually is tedious because you would need to:

  • Let the battery drain to a specific percentage.
  • Plug and unplug the charger at precise moments.
  • Heat or cool the device to trigger temperature‑related throttling.

Using the ADB shell dumpsys battery interface lets you set these values instantly, giving you deterministic, repeatable test cases.

Before You Start

Make sure the device is charged above 30 % before you begin. Although the simulation does not affect the actual charge, a low‑battery device may power‑off during the session, interrupting the test.

  • Enable Developer options on the phone (Settings > About phone > Tap Build number seven times).
  • Turn on USB debugging (Settings > System > Developer options > USB debugging).
  • Install the Android SDK Platform‑Tools on your computer (download from the official Android developer site).
  • Use a USB‑C or micro‑USB cable that supports data transfer, not just charging.

If you are on Windows, ensure the adb.exe directory is added to your PATH variable so you can call adb from any command prompt.

Step 1 – Verify ADB Connection

  1. Open a terminal (Command Prompt, PowerShell, Terminal, or iTerm).
  2. Run adb devices. You should see a line with your device’s serial number and the word device.
    adb devices
    List of devices attached
    FA6B12345678    device
  3. If the device shows as unauthorized, check the phone for a dialog asking to allow USB debugging and tap Allow.

Successful connection is the foundation; all following commands depend on it.

Step 2 – Put the Battery Service into Test Mode

Android’s battery service only accepts overrides when it is explicitly placed in “test mode”. This is a one‑time command per session.

  1. Execute the following command:
    adb shell dumpsys battery set status 1
    Explanation: status 1 tells the system the battery is UNKNOWN, which unlocks the override fields.
  2. Confirm the change by running:
    adb shell dumpsys battery
    Look for a line that reads Battery Status: UNKNOWN. If you see Battery Status: CHARGING or DISCHARGING, repeat step 2.

Step 3 – Simulate Battery Level

Battery level is expressed as an integer from 0 to 100 representing the percentage of charge.

  1. Choose the desired level, e.g., 15 for a low‑battery scenario.
  2. Run the command:
    adb shell dumpsys battery set level 15
  3. Verify with:
    adb shell dumpsys battery | grep "level"
    The output should be level: 15.

Repeat the command with any value between 0 and 100 to test different thresholds.

Step 4 – Simulate Charging State

Charging state influences how the system reports Battery Status. The valid values are:

ValueStatus
1UNKNOWN (used for test mode)
2CHARGING
3DISCHARGING
4NOT CHARGING
5FULL
  1. To simulate a charger plugged in, run:
    adb shell dumpsys battery set status 2
  2. To simulate unplugged, run:
    adb shell dumpsys battery set status 3
  3. After each change, verify with:
    adb shell dumpsys battery | grep "Battery Status"

Combine the level and status commands to mimic, for example, a 5 % battery that is still charging (a rare but possible edge case).

Step 5 – Simulate Battery Temperature

Temperature is reported in tenths of a degree Celsius (e.g., 300 = 30.0 °C). Extreme temperatures trigger thermal throttling or safety shutdowns, which some apps monitor.

  1. Pick a temperature, e.g., 420 for 42 °C.
  2. Run:
    adb shell dumpsys battery set temperature 420
  3. Confirm with:
    adb shell dumpsys battery | grep "temperature"
    Expected output: temperature: 420.

Typical safe operating ranges are 20 °C – 45 °C (200 – 450). Values outside this range may cause the system to display a warning, which you can use to test your app’s response.

Step 6 – Verify the Override from Within Android

Most developers prefer to see the simulated values inside the OS UI rather than only via ADB. You can do this with the built‑in Developer options > Battery usage screen or a simple third‑party app that reads BatteryManager values.

  1. On the device, go to Settings > Battery > Battery usage.
  2. The displayed percentage should match the level you set. If it does not, double‑check that the device is still in test mode (status = 1).
  3. Optionally, install a free app like “AccuBattery” and look at the “Battery health” screen; it reads the same system properties.

Step 7 – Use the Simulation in App Testing

Now that the system reports the values you need, launch the app you are testing. Observe how it reacts:

  • Does a video player switch to a lower bitrate when the level drops below 20 %?
  • Does a sync service pause when the device reports Battery Status: CHARGING = false?
  • Does a health‑monitoring app raise an alert at 42 °C?

Because the override is global, any app on the device will see the same fake values, making it easy to compare behaviors side‑by‑side.

Step 8 – Reset the Battery Service to Real Values

When you finish testing, you must return the system to its natural state. Failing to do so can cause the UI to display an incorrect percentage for days.

  1. Run the reset command:
    adb shell dumpsys battery reset
  2. Optionally, reboot the device to guarantee all caches are cleared.
  3. Verify that adb shell dumpsys battery now shows Battery Status: CHARGING/DISCHARGING and a realistic level value.

After a reset, the phone will again report the true battery level, temperature, and charge state.

Common Issues & Troubleshooting

1. “command not found” or “adb is not recognized”

Ensure the Platform‑Tools folder is in your system PATH. On Windows, you can add it via System > Advanced system settings > Environment Variables. On macOS/Linux, edit ~/.bash_profile or ~/.zshrc to include export PATH=$PATH:/path/to/platform-tools.

2. Device shows Battery Status: UNKNOWN after reset

Some OEM skins (e.g., Samsung One UI) keep the battery service in test mode until a full reboot. Power‑cycle the device and run adb shell dumpsys battery again.

3. Values revert after screen lock or Doze mode

Android may re‑initialize the battery service when entering deep sleep. To keep the override active, you can keep the device awake using adb shell svc power stayon true or enable Stay awake while charging in Developer options. Remember to disable it after testing.

4. Temperature command has no effect on some devices

Older Android versions (< 6.0) ignore the temperature field in test mode. In that case, you can only test level and status. For newer versions, make sure you are using at least Android 7.0 (API 24) where the field is honored.

5. App still reads real battery values

Apps that query the hardware directly via the BatteryManager API will see the overridden values, but apps that read the sysfs path /sys/class/power_supply/battery/ may bypass the override. In such rare cases, you need root to change those files, which is outside the scope of this no‑root tutorial.

Advanced Tips

  • Batch scripting: Create a small shell script that sets level, status, and temperature in one go. Example (Linux/macOS):
    #!/bin/bash
    adb shell dumpsys battery set status 2
    adb shell dumpsys battery set level $1
    adb shell dumpsys battery set temperature $2
    
    Run with ./simulate.sh 30 350 to set 30 % and 35.0 °C.
  • Integrate with CI pipelines: If you run UI tests on an Android emulator, you can add the same dumpsys battery commands to your Gradle or Fastlane scripts, ensuring every test run starts from a known power state.
  • Combine with Battery Historian: After simulating a low‑battery scenario, capture a battery trace (adb shell dumpsys batterystats --reset && adb shell dumpsys batterystats --history) and feed it to Battery Historian to see how the system would have behaved with a real battery drain.

Device‑Specific Notes

While the ADB interface is part of the Android Open Source Project, manufacturers sometimes add custom battery managers that ignore the test mode. Here are a few observations:

  • Pixel / Nexus devices: Fully respect the override on Android 8.0 +.
  • Samsung (One UI): May require a reboot after reset to clear the test flag.
  • Xiaomi (MIUI): The temperature field is capped at 500 (50 °C) even in test mode.
  • Android Go devices: Limited RAM can cause the battery service to restart more aggressively, losing overrides after a few minutes of inactivity.

If you encounter a device that simply does not accept the commands, verify the Android version with adb shell getprop ro.build.version.release and consult the device’s developer forum for any known quirks.

When Not to Use This Technique

Do not leave the battery service in test mode on a daily‑use device. The UI will display inaccurate percentages, which can lead to missed low‑battery warnings and unexpected shutdowns.

Reserve this method for development machines, test phones, or emulators that are not your primary communication device.

Summary

By following the six straightforward ADB commands—setting the service to test mode, adjusting level, status, and temperature, and finally resetting—you gain full control over how Android reports its power state. This empowers you to:

  • Validate app behavior under low‑battery, charging, and high‑temperature conditions.
  • Automate power‑state testing in CI pipelines.
  • Save hours of manual battery‑drain waiting.

The technique works on any non‑rooted device running Android 7.0 or newer, with only a USB cable and the free Platform‑Tools package. Remember to reset the service when you’re done, and you’ll have a reliable, repeatable testing workflow that any Android developer can adopt.

User Comments (0)

Add Comment
We'll never share your email with anyone else.