DroidTest is a small command-line runner for Android adb diagnostics. It reads commands from a file, executes them in sequence, and produces a clean pass/fail summary.
- Runs a list of
adbsubcommands from a file - Reports each command as PASS or FAIL
- Optionally filters output, stops on first failure, exports JSON reports
- Supports per-command timeouts and multi-device targeting
DroidTest.py— entry point (backwards-compatible launcher)droidtest/core.py— command loading and execution logicdroidtest/cli.py— argument parsing and output behaviorlist.txt— default command listtests/— unit testsbackup.py— original single-file version, kept for reference
- Enable Developer options: Settings → About phone → tap Build number 7 times
- Enable USB debugging: Settings → Developer options → USB debugging ON
- Connect via USB and accept the RSA authorization prompt on the phone
- Verify ADB sees your device:
adb devicesYou should see your device serial with device status. If multiple devices are connected, use --device <serial>.
- Device shows
unauthorized→ revoke USB debugging authorizations on the phone and reconnect - No device appears → check USB cable, ensure
adbis in PATH - Restart ADB:
adb kill-server && adb start-server
python DroidTest.py [options]| Flag | Description |
|---|---|
-c, --commands-file |
Path to commands file (default: list.txt) |
-d, --device |
ADB device serial (adb -s) |
-t, --timeout |
Per-command timeout in seconds |
-v, --verbose |
Print command output inline |
-S, --success-only |
Show only successful commands |
-F, --fail-only |
Show only failed commands (mutually exclusive with -S) |
--stop-on-failure |
Stop executing after the first failed command |
--json FILE |
Save full report as JSON |
--success-file FILE |
Append pass details to file |
--fail-file FILE |
Append fail details to file |
python DroidTest.py -v --timeout 8 --json report.json --fail-file failed.logEach non-empty, non-comment line is an adb subcommand. DroidTest prefixes adb automatically:
# comments are allowed
shell getprop ro.product.model
shell dumpsys battery
shell df -h
python -m unittest discover -s tests -p 'test_*.py'| Code | Meaning |
|---|---|
0 |
All commands passed |
1 |
No commands found in input file |
2 |
One or more commands failed |
- Python 3.10+
adbinstalled and available in PATH- No third-party Python dependencies