Find the apps that make your Android device overheat and drain its battery.
Analysis over ADB. No root required, and nothing to install on the device.
Quick Start · ADB Setup · Usage · Reading the Results · FAQ
About ThermoScope
ThermoScope is a lightweight command-line tool that collects diagnostic data from an Android device through the Android Debug Bridge (ADB) and condenses it into a ranked list of likely heat sources, each with a score and the reasons behind it.
Instead of digging through battery, CPU, and log screens one by one, you run a single command.
| Feature | Description |
|---|---|
| Device snapshot | Temperature, battery level, health, charging state, and screen state |
| CPU analysis | Top processes by load, mapped to readable app names |
| Per-app power use | Based on dumpsys batterystats since the last charge |
| Wakelocks and alarms | Detects apps that keep the device awake or wake it too often |
| Suspect scoring | Multiple signals combined into one score so you can prioritize |
| Watch mode | Periodic sampling to find apps that are consistently problematic |
| Guided cleanup | Per-app force-stop, always with confirmation |
| Bilingual output | English and Indonesian, following the target device language |
Important
Safe by default. Without extra options, ThermoScope only reads data. It never uninstalls apps, disables them, clears data, or changes settings.
Quick Start
# 1. Install dependencies (pick your platform)
pkg install bash android-tools # Termux
sudo apt install bash adb # Debian / Ubuntu
brew install bash android-platform-tools # macOS
# 2. Make the script executable
chmod +x thermoscope.sh
# 3. Run it
./thermoscope.sh
Make sure ADB is enabled on the device. Not sure how? Follow the ADB setup guide below.
Sample report (simulated data)
Requirements
| Component | Required | Notes |
|---|---|---|
bash 4.0+ |
Yes | macOS ships with bash 3.2 by default. Upgrade with brew install bash |
adb |
Yes | Part of the Android platform-tools |
| Android device | Yes | USB debugging or Wireless debugging enabled |
aapt / aapt2 + python3 |
Optional | Used to resolve app names automatically. Without them, package names are shown instead |
Note
Running sh thermoscope.sh works too. The script automatically switches to bash.
Windows users: use WSL or Git Bash. With WSL, wireless debugging is much easier than USB.
ADB Setup Guide
This section walks you through preparing an Android device from scratch. There are two paths: USB (most stable) and Wireless (no cable, Android 11 and later).
Step 1: Enable Developer options
Open Settings → About phone and tap "Build number" 7 times until a message confirms that developer mode is on. Enter your screen PIN or pattern if prompted.
The menu name and location vary slightly by manufacturer:
Where to find "Build number" by brand
| Brand / Interface | Location |
|---|---|
| Stock Android / Pixel | Settings → About phone → Build number |
| Xiaomi / Redmi / POCO (MIUI, HyperOS) | Settings → About phone → MIUI version or OS version |
| Samsung (One UI) | Settings → About phone → Software information → Build number |
| OPPO / Realme / OnePlus (ColorOS, realme UI) | Settings → About device → Version → Build number |
| vivo / iQOO (Funtouch, OriginOS) | Settings → About phone → Version info → Software version |
| Infinix / Tecno / itel (XOS, HiOS) | Settings → About phone → Build number |
Menu names can differ between OS versions. If you cannot find it, search for "Build number" in the Settings search bar.
Step 2: Open Developer options
Developer options is now available at:
- Settings → System → Developer options (stock Android, Samsung, and most brands)
- Settings → Additional settings → Developer options (Xiaomi / Redmi / POCO, OPPO / Realme)
Step 3A: USB path
- In Developer options, turn on USB debugging.
- Connect the device to your computer with a data cable (not a charge-only cable).
- When the "Allow USB debugging?" dialog appears, check "Always allow from this computer", then tap Allow.
- Verify on your computer:
bash
adb devices
Expected output:
text
List of devices attached
R58M123ABCD device
A status of device means you are ready. Continue to Usage.
Step 3B: Wireless path (Android 11+)
No cable needed. The device and your computer must be on the same Wi-Fi network.
- In Developer options, turn on Wireless debugging and allow the Wi-Fi network when prompted.
- Tap the Wireless debugging label itself (not just the toggle) to open its detail page.
-
Pairing (one time only): - Tap Pair device with pairing code. - The device shows a pairing IP:PORT and a 6-digit code. - On your computer, run:
bash adb pair 192.168.1.10:37215Then enter the 6-digit code when prompted. 4. Connect: go back to the main Wireless debugging page. Note the IP address & Port shown there (this port is different from the pairing port), then run:
bash
adb connect 192.168.1.10:41873
- Verify with
adb devices. An entry such as192.168.1.10:41873 devicemeans the connection works.
Tip
You can skip the manual adb connect step. Just run ./thermoscope.sh --target 192.168.1.10:41873 and ThermoScope will try to connect on its own.
Running ThermoScope from Termux on the same device
You can analyze the device you are holding by using Termux:
- Install Termux, then run
pkg install bash android-tools. - Make sure the device is connected to Wi-Fi, then turn on Wireless debugging.
- Open the pairing code dialog and show Termux next to it using split-screen or a floating window. The pairing dialog closes if you switch away from Settings completely.
- In Termux, run
adb pair IP:PAIRING_PORTand enter the 6-digit code. - Run
adb connect IP:PORTusing the port from the main Wireless debugging page, then./thermoscope.sh --target IP:PORT.
Android 10 and below (no Wireless debugging menu)
Built-in Wireless debugging only exists on Android 11 and later. On older versions, set it up once over USB:
adb devices # confirm the device is detected over USB
adb tcpip 5555 # switch adbd to TCP/IP mode
# unplug the USB cable
adb connect 192.168.1.10:5555
You can find the device IP under Settings → About phone → Status. This setting is lost after the device restarts.
Step 4: Install ADB on your computer
| System | Command |
|---|---|
| Termux | pkg install android-tools |
| Debian / Ubuntu | sudo apt install adb |
| macOS | brew install android-platform-tools |
| Windows | Download the official SDK Platform-Tools from Android Developers, extract it, and add the folder to your PATH |
Security practices after you finish
Warning
Debugging grants broad access to the device. Make it a habit to: - Only accept the "Allow USB debugging?" dialog from computers you recognize. - Turn off USB debugging and Wireless debugging when you are done. - Revoke old authorizations under Developer options → Revoke USB debugging authorizations. - Avoid Wireless debugging on public Wi-Fi.
Usage
┌──────────────┐ ADB ┌──────────────┐ ┌───────────────┐
│ thermoscope │ ───────────▶ │ Android │ ──▶ │ Data: temp, │
│ .sh │ │ device │ │ CPU, power, │
└──────────────┘ └──────────────┘ │ wakelocks ... │
└───────┬───────┘
▼
Score and ranked list of heat suspects
Mode 1: Report (read-only)
./thermoscope.sh
Without --target, ThermoScope lists detected ADB devices and asks for an IP:port. Press Enter to use the device that is already connected (shown inside the [ ] brackets).
Mode 2: Watch (--watch)
./thermoscope.sh --watch 10
Samples every 30 seconds for N minutes (default: 5), then lists the apps that were consistently high along with the peak temperature during the run. Useful for problems that come and go.
Mode 3: Clean (--clean)
./thermoscope.sh --clean
For each suspect, ThermoScope asks for confirmation before acting:
| Input | Action |
|---|---|
y |
Force-stop the app |
n or Enter |
Skip |
q |
Quit, remaining apps are not processed |
Note
Force-stop is temporary. The app may start again on its own. If the same app keeps showing up, restrict its battery usage in Settings or consider uninstalling it manually.
Option reference
| Option | Description |
|---|---|
| (no options) | Read-only report |
--clean |
Interactive cleanup (per-app force-stop, with confirmation) |
--watch [min] |
Sample periodically to find consistently high apps (default 5 minutes) |
--target IP:PORT |
Use a specific ADB address directly, with no prompt. USB serials from adb devices also work |
--lang id\|en |
Force the output language. Default: follow the target device language |
-h, --help |
Show help |
--version |
Show version |
./thermoscope.sh --lang en --target 192.168.1.10:5555
./thermoscope.sh --watch 10
./thermoscope.sh --clean
--help output
Reading the Results
| Report section | Contents |
|---|---|
| Device & battery | Model, Android version, uptime, level, temperature, health, charging state, screen state. A warning appears when temperature is 42 °C or higher |
| Top CPU | Snapshot of the processes with the highest CPU load |
| Per-app power use | Estimated mAh since the last charge |
| Active wakelocks | Apps currently preventing the device from sleeping |
| Top alarms / wakeups | Apps that wake the device most often |
| Doze whitelist | Apps exempted from Doze battery optimization |
| Recent crashes / ANRs | Number of crashes and Application Not Responding events in the logs |
| Heat suspects (score) | Final summary, sorted by score with the reasons listed |
While the device is charging, ThermoScope adds a note that some heat is expected in that state, but CPU figures are still counted.
Scoring system
Each user app receives points from several signals. The higher the score, the more worth investigating.
| Signal | Points |
|---|---|
| CPU ≥ 50% / ≥ 20% / ≥ 5% / ≥ 1% | 12 / 8 / 4 / 1 |
| Active (CPU ≥ 1%) while the screen is off | +3 |
| Holds a wakelock | +6 |
| Alarm wakeups per day ≥ 100 / 50 / 20 / 5 / 1 | 6 / 5 / 4 / 3 / 2 |
| Listed in the Doze whitelist | +1 |
| Power use ≥ 20 / 10 / 5 / 2 / 1 mAh | 10 / 7 / 4 / 2 / 1 |
Not scored: core Android components, vendor apps (Xiaomi, Samsung, OPPO, vivo, and others), Google Play Services, keyboards (IMEs), and Termux.
In --watch mode, an app counts as "detected" in a sample when its CPU is at least 5% (screen on) or at least 1% (screen off).
Security and Limitations
- The default mode only runs read commands through
adb shell. --cleanonly runsam force-stop, and only after you typeyfor that specific app.- Only apps with a score of 2 or higher are offered for stopping.
- Core system components, WhatsApp, and Termux are always skipped.
- No uninstalling, disabling, clearing data, or changing settings.
Configuration
| Environment variable | Purpose | Default |
|---|---|---|
THERMOSCOPE_LOG |
Log file location | ~/thermoscope.log |
THERMOSCOPE_LANG |
Force the language (id / en) |
Automatic |
THERMOSCOPE_LABEL_CACHE |
App name cache location | ~/.thermoscope_labels |
THERMOSCOPE_LABEL_BUDGET |
Maximum apps to resolve names for per run | 12 |
All output is also written to the log file, which makes it easy to review later or attach to a bug report.
THERMOSCOPE_LOG=./result.log ./thermoscope.sh --lang en
FAQ and Troubleshooting
thermoscope.sh requires bash 4+
Your bash version is too old (common on macOS). Upgrade it and run again:
brew install bash # macOS
pkg install bash # Termux
sudo apt install bash # Debian / Ubuntu
bash thermoscope.sh
No ADB target
No device was detected. Connect over USB (make sure USB debugging is on), or enter the Wireless debugging IP:port when prompted.
Failed to connect to ...
- Double-check the IP and port. The connection port is different from the pairing port.
- Make sure the device and computer are on the same Wi-Fi network.
- On Android 11+, pair first:
adb pair IP:PAIRING_PORT. - The Wireless debugging port can change each time the feature is toggled. Check the latest port on the device screen.
Device shows unauthorized or offline in adb devices
unauthorized: accept the "Allow USB debugging?" dialog on the device. If it does not appear, revoke authorizations in Developer options and reconnect the cable.offline: restart the ADB server and reconnect.
adb kill-server
adb start-server
adb devices
(batterystats data not available on this device)
Some devices restrict access to dumpsys batterystats. The other report sections still run normally.
App names appear as package names (for example com.example.app)
Install aapt/aapt2 and python3 so app names can be resolved automatically. Results are cached, so later runs are faster. Without them, ThermoScope still works.
Does it need root?
No. ThermoScope uses standard ADB commands (dumpsys, top, logcat, pm). The only action that changes an app's state is am force-stop in --clean mode.
License
ThermoScope is released under the Apache License 2.0. You are free to use, modify, and distribute it, including for commercial purposes, as long as you include the license text and copyright notice. See the LICENSE file for the full terms.
ThermoScope v2.1 · Built to help you find the cause of an overheating device quickly and safely.
All screenshots in this document use simulated data. Results on your device will differ.