Skip to content

rushivt/droidpulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DroidPulse πŸ€–πŸ’“

AI-Powered Android Device Health Dashboard using ADB

DroidPulse connects to Android devices via ADB, collects system health data (battery, storage, apps, network, CPU/memory), and uses Groq AI (Llama 3.3 70B) to analyze device health, flag issues, and generate actionable recommendations.

Features

  • πŸ“± ADB Device Discovery β€” auto-detect USB and WiFi-connected devices
  • πŸ”‹ Health Data Collection β€” battery, storage, memory, CPU, network, installed apps
  • 🌐 WiFi Diagnostics β€” signal strength, frequency band, latency, DNS checks
  • πŸ€– AI-Powered Analysis β€” Groq AI (Llama 3.3) analyzes health data and flags issues
  • πŸ“Š Terminal Dashboard β€” color-coded health summary in your terminal
  • πŸ“„ HTML Reports β€” professional reports with health scores and recommendations
  • πŸ“‘ ADB over WiFi β€” manage devices wirelessly
  • πŸ” Multi-Device Support β€” scan and report on multiple devices
  • ⏱️ Automation Ready β€” supports scheduled scans via cron or systemd timers

Terminal Dashboard

DroidPulse Terminal Dashboard

HTML Report

DroidPulse HTML Report

Tech Stack

  • Python 3 β€” core logic, data processing, AI integration
  • Bash β€” ADB command wrappers, automation scripts
  • ADB β€” Android device data collection
  • Groq AI (Llama 3.3 70B) β€” AI-powered health analysis
  • Rich β€” terminal dashboard formatting
  • Jinja2 β€” HTML report templating
  • Fedora Linux β€” host operating system

Environment Setup

Prerequisites

  • Fedora Workstation (tested on Fedora 41)
  • Android device with USB cable (tested on OnePlus Nord AC2001, Android 12)
  • Python 3.x
  • Groq API key (free at https://console.groq.com)

Step 1: Install RPM Fusion Repositories

Fedora's default repos ship a limited ffmpeg-free without H.264/H.265 codecs. RPM Fusion provides the full versions.

# Free repository
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

# Non-free repository
sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Step 2: Install Full FFmpeg

Replace Fedora's limited ffmpeg-free with the full version from RPM Fusion. This is required for scrcpy's H.264/H.265 video decoding.

sudo dnf swap ffmpeg-free ffmpeg --allowerasing
sudo dnf install ffmpeg-libs

Step 3: Install ADB (Android Debug Bridge)

The android-tools package provides both adb and fastboot. Running sudo dnf install adb also works as it resolves to the same package.

sudo dnf install android-tools

Step 4: Install scrcpy

scrcpy is not in Fedora's default repos. Install via COPR:

sudo dnf copr enable zeno/scrcpy
sudo dnf install scrcpy

Step 5: Enable USB Debugging on Android Device

  1. Go to Settings β†’ About Phone
  2. Tap Build Number 7 times to enable Developer Options
  3. Go to Settings β†’ Developer Options
  4. Enable USB Debugging
  5. Connect USB cable to your Linux machine
  6. On the phone, tap Allow USB Debugging when prompted (check "Always allow")

Step 6: Verify ADB Connection

# Check USB detection
lsusb
# Should show your device, e.g.: Bus 001 Device 008: ID 22d9:276a OPPO Electronics Corp. OnePlus Nord

# Start ADB server and check device
adb kill-server
adb start-server
adb devices
# Should show: <serial>    device

Troubleshooting: If adb devices shows nothing, add a udev rule for your device. For OnePlus/OPPO (vendor ID 22d9):

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="22d9", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Common vendor IDs: Google=18d1, Samsung=04e8, Xiaomi=2717, Huawei=12d1.

Step 7: Verify scrcpy

scrcpy --always-on-top

If you see ERROR: [FFmpeg] Unable to create decoder, ensure you completed Step 2 (full FFmpeg swap).

Step 9: ADB over WiFi Setup (Optional)

For wireless device management, both your Linux machine and Android device must be on the same network.

For VMs: Set the network adapter to Bridged mode so the VM gets an IP on the same subnet as the phone.

# Connect via USB first, then switch to WiFi mode
adb tcpip 5555

# Find phone's IP address
adb shell ip addr show wlan0 | grep inet

# Disconnect USB cable, then connect wirelessly
adb connect <phone-ip>:5555

# Verify
adb devices
# Should show: <phone-ip>:5555    device

# To switch back to USB mode
adb usb

Security Note: ADB over WiFi has no encryption after initial pairing. Always run adb usb to disable WiFi mode when done.

Step 9: Install DroidPulse Dependencies

cd droidpulse
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Step 10: Set Groq API Key

export GROQ_API_KEY="your-api-key-here"

Usage

# Activate virtual environment
source venv/bin/activate

# Run DroidPulse (default: terminal dashboard)
cd src
python main.py

# JSON output only
python main.py --json

# Verbose mode (raw data + dashboard)
python main.py --verbose

# Generate HTML report
python main.py --report

# Target a specific device
python main.py --device a9686ef3

# Switch to WiFi ADB mode
python main.py --wifi

# Switch back to USB mode
python main.py --usb

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DroidPulse                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                      β”‚
β”‚  main.py (Entry Point)                              β”‚
β”‚    β”œβ”€β”€ collector.py (ADB Data Collection)           β”‚
β”‚    β”œβ”€β”€ wifi_manager.py (Network Diagnostics)        β”‚
β”‚    β”œβ”€β”€ analyzer.py (AI Analysis)                    β”‚
β”‚    β”‚     β”œβ”€β”€ Groq API (Llama 3.3 70B)              β”‚
β”‚    β”‚     └── Rule-based fallback                    β”‚
β”‚    β”œβ”€β”€ dashboard.py (Terminal Output)               β”‚
β”‚    └── reporter.py (HTML Report)                    β”‚
β”‚                                                      β”‚
β”‚  scripts/                                            β”‚
β”‚    β”œβ”€β”€ adb_commands.sh (Bash ADB wrappers)          β”‚
β”‚    └── scan_all_devices.sh (Multi-device scanner)   β”‚
β”‚                                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Android Device ←── ADB (USB / WiFi) ──→ Fedora    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

droidpulse/
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ adb_commands.sh          # Bash ADB wrappers
β”‚   └── scan_all_devices.sh      # Multi-device scanner
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ main.py                  # Entry point with CLI args
β”‚   β”œβ”€β”€ collector.py             # ADB data collection
β”‚   β”œβ”€β”€ analyzer.py              # Groq AI health analysis
β”‚   β”œβ”€β”€ dashboard.py             # Rich terminal dashboard
β”‚   β”œβ”€β”€ reporter.py              # HTML report generator
β”‚   └── wifi_manager.py          # WiFi diagnostics & ADB over WiFi
β”œβ”€β”€ reports/                     # Generated HTML reports
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ runbook.md               # Troubleshooting & setup docs
β”‚   └── images/                  # Screenshots
└── venv/                        # Python virtual environment

Documentation

  • πŸ“– Runbook β€” setup procedures, troubleshooting guide, ADB command reference, architecture
  • πŸ“‹ Project Board β€” development progress tracking

License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

DroidPulse - AI-Powered Android Device Health Dashboard using ADB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors