sadb is a powerful wrapper for Android Debug Bridge (adb) that simplifies multi-device management and command automation.
- π± Smart Device Selection: Automatically prompts for device selection when multiple devices are connected. Supports
fzffor fuzzy searching. - β‘ Batch Execution: Run a single command on ALL connected devices simultaneously.
- π Command Aliases: Define short aliases for complex adb commands (e.g.,
sadb alias log "logcat -v time"). - π οΈ Custom Methods: Create powerful multi-line scripts combining
adband local shell commands with automatic device targeting. - π― Active Device Lock: Lock onto a specific device serial for the current session to skip selection prompts.
- π¨ Modern UI: Beautifully formatted tables with status-based coloring and clear execution headers.
Download the sadb script and set the execution permission:
# For system-wide install (requires sudo):
sudo curl -L https://raw.githubusercontent.com/UncleBrook/sadb/main/sadb -o /usr/local/bin/sadb
sudo chmod +x /usr/local/bin/sadb
# For user-only install (ensure ~/.local/bin is in your PATH):
mkdir -p ~/.local/bin
curl -L https://raw.githubusercontent.com/UncleBrook/sadb/main/sadb -o ~/.local/bin/sadb
chmod +x ~/.local/bin/sadbDownload the completion script and load it in your shell configuration:
For Bash:
- Download the script:
mkdir -p ~/.config/sadb curl -L https://raw.githubusercontent.com/UncleBrook/sadb/main/sadb-completion.bash -o ~/.config/sadb/sadb-completion.bash
- Add the following to your
~/.bashrc:[[ -f ~/.config/sadb/sadb-completion.bash ]] && source ~/.config/sadb/sadb-completion.bash
For Zsh:
- Download the script:
mkdir -p ~/.config/sadb curl -L https://raw.githubusercontent.com/UncleBrook/sadb/main/sadb-completion.bash -o ~/.config/sadb/sadb-completion.bash
- Add the following to your
~/.zshrc:autoload -Uz bashcompinit && bashcompinit source ~/.config/sadb/sadb-completion.bash
Add an alias to your shell configuration (~/.bashrc or ~/.zshrc) to use sadb as a drop-in replacement for adb:
alias adb="sadb"If you prefer an automated setup, use the installation script which handles everything above for you:
curl -s https://raw.githubusercontent.com/UncleBrook/sadb/main/install.sh | bashsadb supports all standard adb commands and adds several powerful management features.
The alias command allows you to manage short commands and complex methods.
| Command | Description |
|---|---|
sadb alias -l -s [mode] |
List and sort aliases/methods (a|alpha, r|reverse, l|length) |
sadb alias -r <key> |
Remove a specific alias or method |
sadb alias -h, --help |
Display detailed help for the alias command |
sadb alias <key> <value> |
Add or update a command alias |
sadb alias.<key> <value> |
Shorthand to add a command alias |
sadb alias <key> |
Show the definition of a specific alias |
Set an active device for the current terminal session only. This avoids selection prompts without affecting other windows.
| Command | Description |
|---|---|
sadb active |
Trigger interactive selection (or auto-select if only one device is connected) |
sadb active <serial> |
Lock the current session to a specific device serial |
sadb active -d |
Unlock and return to interactive selection mode |
sadb active -h |
Display detailed help for the active command |
sadb provides a modern, color-coded table for listing devices. Active devices for the current session are highlighted in yellow.
| Command | Description |
|---|---|
sadb devices |
List connected devices in a beautified table and highlight the active device |
Commands like start-server, kill-server, connect, pair, version, etc., are passed directly to the original adb binary.
If multiple devices are connected, simply run any adb command:
sadb shellIf fzf is installed, you can search and select your device instantly.
sadb active # Select a device to lock onto for this terminal session
sadb devices # See the list with the active device highlighted
sadb active -d # Unlock and return to interactive selection mode# Create an alias
sadb alias ws "wm size"
# Use it
sadb wsDefine complex workflows in ~/.config/sadb/.alias:
# Example Method
my_workflow() {
local scale=$1
echo "Starting workflow..."
adb shell settings put global window_animation_scale $scale
adb shell settings put global transition_animation_scale $scale
adb shell settings put global animator_duration_scale $scale
echo "Workflow complete!"
}sadb automatically injects ANDROID_SERIAL, so you don't need -s inside methods.
- Bash v4.0+ (Required for associative arrays)
- adb (Android SDK Platform-Tools)
- fzf (Optional, for better interactive experience)
This project is licensed under the Apache License 2.0.


