DroidTUI ๐ค

A beautiful Terminal User Interface (TUI) for Android development โ ADB commands, live logcat viewer, device dashboard, and more. Built with Rust, Ratatui, and the pure-Rust adb_client crate (no Android SDK required).
Features โจ
๐บ Live Logcat Viewer
Full-screen, real-time logcat streaming with professional-grade tooling:
- Live streaming via
adb_client's native API โ no adb binary needed
- Regex search (
r toggle) โ powerful pattern matching (Error|Exception, OkHttp.*failed)
- Find filter (
f) โ case-insensitive substring search with match highlighting
- Exclude filter (
e) โ negative matching to hide noisy tags/messages
- Tag & PID filters (
t, p) โ dedicated filter fields
- Log level filter (
l) โ cycle minimum level V โ D โ I โ W โ E โ F
- Per-tag color hashing โ each tag gets a stable, visually distinct color
- Stack trace folding (
F) โ detect and fold/unfold Java/Kotlin stack traces
- Line detail popup (
Enter) โ inspect any line with full message, JSON formatting
- Bookmarks (
m, [, ]) โ mark lines and jump between them
- Copy to clipboard (
y) โ copy selected line via pbcopy/xclip
- Soft wrap (
w) โ wrap long messages across multiple rows with aligned indentation
- Compact mode (
x) โ hide timestamp/PID columns for more message space
- Horizontal scroll (
โ/โ) โ scroll long messages when wrap is off
- Auto-scroll โ sticks to bottom; manual scroll disables;
G/End re-enables
- Pause / Resume (
Space) โ freeze the view without losing the stream
- Live stats โ lines/sec rate and per-level counters in the status bar
- Save logs (
s) โ save to file with path input dialog
- Save Asโฆ (
S) โ browse with integrated file explorer, Shift+S to save in current folder
- JSON export โ Tab in save dialog cycles TXT/JSON format (JSONL for Nushell/jq)
- Bounded channel โ
sync_channel(10k) with backpressure prevents OOM during bursts
- JSON detection โ auto-detects and pretty-prints JSON in log messages with syntax coloring
๐ฑ ADB Command Dashboard
- Device panel โ live device selector with model, Android version, battery, RAM, CPU stats
- 40+ typed commands โ packages, system, network, root toolkit, bootloader & flash
- Fastboot support โ OEM unlock/lock, wipe data, device info
- Type-safe execution โ compile-time guarantees via
adb_client crate
๐จ Theme System
- 12 named presets โ Default, Dracula, Nord, Gruvbox Dark, Catppuccin Mocha, Tokyo Night, Solarized Dark, Moonfly, Oxocarbon, Forest, Neon, Mono
- Global selector (
Shift+T) โ works from any screen
- 11 colour fields โ brand, accent, success, dim, fg, sel_bg, warn, error, surface, border, key_hint
๐ฅ๏ธ CLI Query Mode
Stream logcat as JSON lines to stdout โ designed for piping into Nushell, jq, or grep:
droidtui --query droidtui --query --last 500 droidtui --query --level E droidtui --query --tag MyApp droidtui --query --grep "timeout" droidtui --query | nu -c 'lines | each { from json } | where level == "Error"'
๐ Nushell Recipe Scripts
Pre-built analysis scripts in scripts/logcat/:
| Script |
What it does |
top_tags.nu |
Rank tags by frequency (top 20) |
error_summary.nu |
Group Error/Fatal by tag with sample messages |
timeline.nu |
Log volume + error count per second |
find_crashes.nu |
Detect Fatal entries, ANRs, exceptions |
filter_json.nu |
Extract and pretty-print JSON payloads from messages |
droidtui --query --last 5000 > logcat.jsonl
nu scripts/logcat/top_tags.nu logcat.jsonl
Installation ๐ง
From crates.io
cargo install droidtui
From source
git clone https://github.com/sorinirimies/droidtui.git
cd droidtui
cargo install --path .
Prerequisites
- ADB server running (
adb start-server) โ the adb binary is only needed to start the server; all commands use the pure-Rust adb_client crate
- A connected Android device with USB debugging enabled
Usage ๐ฎ
droidtui droidtui --query droidtui --help
Key Bindings โ Main Menu
| Key |
Action |
โ/โ or j/k |
Navigate menu |
Tab / Shift+Tab |
Jump between sections |
Enter |
Execute selected command |
L |
Open Live Logcat |
T |
Open Theme Selector |
d |
Cycle connected device |
r |
Refresh device info |
q / Esc |
Quit |
Key Bindings โ Logcat Viewer
Navigation
| Key |
Action |
โ/โ or j/k |
Scroll up/down |
PgUp / PgDn |
Scroll 20 lines |
g / G or Home/End |
Jump to top / bottom |
โ / โ |
Horizontal scroll (when wrap off) |
0 |
Reset horizontal scroll |
Filters
| Key |
Action |
f |
Find (search filter) |
e |
Exclude filter (negative match) |
t |
Tag filter |
p |
PID filter |
l |
Cycle log level (VโDโIโWโEโF) |
r |
Toggle regex mode |
Actions
| Key |
Action |
Enter |
Line detail popup (with JSON formatting) |
y |
Copy line to clipboard |
m |
Toggle bookmark |
[ / ] |
Jump to prev/next bookmark |
F |
Fold/unfold stack trace |
w |
Toggle soft wrap |
x |
Toggle compact mode |
Space |
Pause / resume |
c |
Clear all entries |
s |
Save logs |
S |
Save Asโฆ (file browser) |
q / Esc |
Close logcat |
Save Dialog
| Key |
Action |
Enter |
Save to typed path |
S |
Save Asโฆ (open file browser) |
Tab |
Cycle format: TXT all โ TXT filtered โ JSON all โ JSON filtered |
Esc |
Cancel |
File Browser (Save Asโฆ)
| Key |
Action |
โ/โ |
Navigate |
Enter / l |
Open directory / select file |
h / โ / Backspace |
Go to parent |
Shift+S |
Save Here (into current directory) |
/ |
Incremental search |
n |
Create new folder |
. |
Toggle hidden files |
s |
Cycle sort mode |
Esc |
Back to path input |
Architecture ๐๏ธ
DroidTUI follows an Elm-like architecture with clear separation of concerns:
โโโ Model โโโโโโโโโโโโโโโโโโโโโโโ
โ app state, menu, logcat, โ
โ device status, theme โ
โโโ Message โโโโโโโโโโโโโโโโโโโโโค
โ all possible state changes โ
โโโ Update โโโโโโโโโโโโโโโโโโโโโโค
โ message โ state transitions โ
โโโ View โโโโโโโโโโโโโโโโโโโโโโโโค
โ model โ terminal rendering โ
โโโ Event โโโโโโโโโโโโโโโโโโโโโโโค
โ keyboard, tick โ messages โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Project Structure
droidtui/
โโโ src/
โ โโโ main.rs # Entry point + CLI query mode
โ โโโ app.rs # Event loop, key โ message mapping
โ โโโ model.rs # All application state
โ โโโ view.rs # UI rendering (ratatui)
โ โโโ update.rs # State transitions
โ โโโ message.rs # Message enum
โ โโโ event.rs # Async event handling
โ โโโ menu.rs # Command menu widget
โ โโโ adb.rs # ADB client abstraction
โ โโโ fastboot.rs # Fastboot command support
โ โโโ logcat.rs # Logcat viewer (streaming, parsing, filters, stats)
โ โโโ theme.rs # Theme system (12 presets, selector)
โ โโโ effects.rs # Visual effects (TachyonFX)
โ โโโ lib.rs # Library exports
โโโ scripts/
โ โโโ logcat/ # Nushell recipe scripts
โ โโโ bump_version.nu
โ โโโ release_prepare.nu
โโโ tests/
โ โโโ adb_integration_tests.rs
โโโ examples/
โโโ Cargo.toml
Dependencies ๐ฆ
| Crate |
Purpose |
ratatui |
Terminal UI framework |
crossterm |
Cross-platform terminal I/O |
adb_client |
Pure-Rust ADB protocol client |
tokio |
Async runtime |
tachyonfx |
Visual effects & animations |
regex |
Regex search in logcat |
serde + serde_json |
JSON serialization for logcat export |
tui-file-explorer |
File browser widget (save dialog) |
color-eyre |
Error handling |
Development ๐ ๏ธ
cargo test cargo clippy --all-targets --all-features -- -D warnings cargo fmt --check just release patch
Adding New ADB Commands
- Add a variant to
AdbCommand in src/adb.rs
- Implement the handler in
AdbManager::execute
- Add a menu entry in
src/menu.rs via build_entries()
- Tests in
tests/adb_integration_tests.rs
Contributing ๐ค
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing)
- Run
cargo fmt && cargo clippy --all-targets --all-features -- -D warnings && cargo test
- Commit and push
- Open a Pull Request
License ๐
MIT โ Copyright (c) Sorin Albu-Irimies
Acknowledgments ๐
Made with โค๏ธ and โ for Android developers ยท Powered by Rust ๐ฆ