DEV Community

Stephano Kambeta
Stephano Kambeta

Posted on

Monitoring Device Logs and Info Using Termux Tools

Termux is not just for hacking tools or coding. It can be your everyday monitoring companion. With the right commands, you can check your phone's battery status, CPU usage, running processes, and system logs—all from your terminal.

Why Monitor Device Logs and Info?

Monitoring system logs and device info can help you understand what’s going on under the hood. Whether you're troubleshooting a slow phone or learning how Android works, Termux can give you deep access to system behavior.

If you're diving into computer security or learning ethical hacking, system logs can expose hidden background processes or malicious activity, helping you detect security issues early.

Step 1: Setting Up Termux

If you're new to Termux, begin by installing it from F-Droid or GitHub. Here's a guide that will help you with how to install Termux on Android.

Once installed, always update your packages:

pkg update && pkg upgrade -y

Enter fullscreen mode Exit fullscreen mode

Step 2: Install Required Packages

To monitor logs and device info, you’ll need a few basic packages:

pkg install termux-api util-linux proot -y

Enter fullscreen mode Exit fullscreen mode

termux-api enables access to Android hardware info, while util-linux includes helpful commands like dmesg and lsblk.

Step 3: Viewing System Logs with logcat

logcat is the Android system log reader. It's the same tool used by developers to debug apps and by hackers to analyze system behavior.

To start monitoring logs in real-time:

logcat

Enter fullscreen mode Exit fullscreen mode

If you only want logs related to network or apps, filter them using grep:

logcat | grep net

Enter fullscreen mode Exit fullscreen mode

This is especially useful when checking for background app activity during an active network session. You can test this while using tools like Ngrok to expose a local server or tunnel connections.

Step 4: Monitor Battery, CPU, and Memory in Real-Time

Use termux-battery-status to check battery level, temperature, and charging status:

termux-battery-status

Enter fullscreen mode Exit fullscreen mode

For ongoing monitoring, you can loop the command:

while true; do termux-battery-status; sleep 10; clear; done

Enter fullscreen mode Exit fullscreen mode

To check your CPU details:

lscpu

Enter fullscreen mode Exit fullscreen mode

To view RAM stats:

cat /proc/meminfo

Enter fullscreen mode Exit fullscreen mode

And to monitor your storage usage:

df -h

Enter fullscreen mode Exit fullscreen mode

All these are essential when running heavier Termux tools or setting up projects like Quick Termux Projects that use more resources than usual.

Step 5: Network and Telephony Information

Termux allows access to network interfaces and SIM data using:

ip a
termux-telephony-deviceinfo

Enter fullscreen mode Exit fullscreen mode

These commands are useful when you want to log your connection type, network signal strength, or switch between Wi-Fi and mobile data securely—especially when using a VPN with Termux.

Step 6: Track Running Processes with top and htop

Use top for a live view of running processes and CPU usage:

top

Enter fullscreen mode Exit fullscreen mode

If you want a cleaner, color-coded version:

pkg install htop
htop

Enter fullscreen mode Exit fullscreen mode

This is helpful for tracking which scripts or background services are hogging resources. You’ll find it useful when testing tools like Netcat in Termux for listening or port forwarding tasks.

Step 7: Save Logs for Later

You might want to save your logs to a file:

logcat > my_logs.txt
termux-battery-status > battery_info.txt

Enter fullscreen mode Exit fullscreen mode

To view the saved file:

cat my_logs.txt

Enter fullscreen mode Exit fullscreen mode

You can even copy the file to a PC for further analysis or include it in reports if you’re doing any penetration testing practice.

Use Cases for Monitoring with Termux

  • Debug Battery Drain: Check what processes run when the battery drops fast.
  • App Behavior: Log how an app behaves during install or uninstall.
  • Network Monitoring: View logs while your phone connects to unknown networks.
  • Privacy Check: Detect if apps are sending unexpected network requests in the background.

Final Words

Termux gives you powerful control over your Android device. By using simple commands, you can monitor logs, battery, CPU, memory, and network data—all in real time. This is useful not just for debugging, but also for security testing and understanding how your system works.

Whether you're working on a project or learning mobile cyber hygiene, this is a great step toward becoming more aware and in control of your device.

For more ideas, tutorials, and tools, explore the rest of our content on Terminal Tools Blog.

Top comments (0)