DEV Community

Pawel Piecuch
Pawel Piecuch

Posted on

padb: A TUI for Android Debugging That Lives in Your Terminal

If you've spent any time doing Android development from the command line, you know the rhythm: adb devices, adb logcat, adb shell, repeat. It works, but it's friction — switching between windows, retyping device serials, manually grep-ing through logcat noise.

padb is a Python-based terminal UI that wraps all of that into one interactive session. No GUI required, no Android Studio open in the background.


What it is

padb runs in your terminal and gives you three things at once:

  • An interactive shell for ADB commands with history and autocompletion
  • Live logcat with regex filtering and color-coded log levels, running in the bottom half of your screen
  • A two-panel file commander (Norton Commander-style) for pushing and pulling files between your machine and the device

It handles both USB and wireless devices, including Android 11+ wireless pairing.


Getting started

git clone https://github.com/yourusername/padb
cd padb
pip3 install -r requirements.txt
python3 main.py
Enter fullscreen mode Exit fullscreen mode

Requirements: Python 3.11+, adb in PATH (or Android SDK installed).

On launch, padb auto-detects connected devices. One device → connects immediately. Multiple devices → shows a selection menu. No devices → waiting screen with background auto-reconnect.


The shell

The top half of the screen is an interactive ADB shell. Type any shell command and it runs on the device:

> ls /sdcard/Download
> pm list packages | grep com.example
> dumpsys battery
Enter fullscreen mode Exit fullscreen mode

There's command history (persisted to .padbrc between sessions) and context-aware suggestions.

The real time-saver is meta commands — prefixed with @, they run common operations without leaving the shell:

Command What it does
@install app.apk Install APK from local path
@pull /sdcard/file.txt Pull file to current directory
@push ./local.txt /sdcard/ Push local file to device
@screenshot Take screenshot, save locally
@reboot Reboot the device
@connect 192.168.1.100 Connect to a wireless device
@pair 192.168.1.100:12345 Pair with Android 11+ pairing code
@discover Auto-discover devices via mDNS
@saved List remembered wireless IPs
@forget 192.168.1.100 Remove a saved wireless IP

Live logcat

The bottom panel streams logcat in real time. You can filter by regex without stopping the stream — the filter applies to all incoming lines immediately.

Log levels get distinct colors: verbose is dim, debug is cyan, info is green, warning is yellow, error is red. On a busy app this makes a real difference when you're scanning for a specific error.


File commander

Press F to open the file commander. Left panel shows your local filesystem, right panel shows the device filesystem. Navigate with arrow keys, Enter to descend, Backspace to go up. Tab switches between panels.

C copies the selected file across panels (local→device or device→local). That's the main workflow: browse to what you need, copy it over.


Wireless workflow

For wireless debugging, padb stores connected device IPs in ~/.padb_wireless.json and tries to reconnect them automatically every time it starts. If the device is on the same network, you typically don't need to do anything — it just connects.

For first-time wireless setup:

Android 11+ (recommended):

  1. Enable wireless debugging in developer options
  2. Tap "Pair device with pairing code" — note the IP:port and 6-digit code
  3. In padb shell: @pair 192.168.1.100:12345 then enter the code
  4. After pairing: @connect 192.168.1.100

Legacy tcpip mode:

  1. Connect USB, then: @tcpip (enables TCP on port 5555 and prints the device IP)
  2. Disconnect USB, then: @connect 192.168.1.100

After either method, the IP is saved and auto-reconnected on future launches.

mDNS discovery (@discover or press D from the waiting screen) works when your device advertises itself on the local network — useful for Android 11+ wireless debugging without knowing the IP.


Why terminal

The short answer: it stays out of the way. No IDE startup time, no separate window to manage. If you're already working in the terminal — running builds, checking git — padb fits into that flow without switching context.

The longer answer: logcat + shell in a split view changes how you debug. You trigger something in the shell and watch the log response in the same window, without alt-tabbing. It sounds small, but the tight feedback loop adds up over a day of debugging.


Current state

padb is actively developed. The core features — shell, logcat, file commander, wireless — are solid for daily use. The project is MIT licensed and contributions are welcome.

Source: github.com/yourusername/padb


Built with Python, curses, and adbutils. Tested on macOS and Linux.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.