Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

143 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

termux-adb

Run adb and fastboot in Termux without root permissions!

Version License

Description

This is a modified version of adb and fastboot which enables debugging of one Android device from another via USB cable. It should work with any USB-C male-to-male cable or the corresponding OTG adapter + cable in case of micro USB.

Features ✨

  • πŸ”§ Root-free ADB and Fastboot for Termux
  • 🎨 Enhanced installer with colored output (2026)
  • βœ… Automatic installation verification
  • πŸ”’ GPG signature verification for security
  • πŸ“ Comprehensive logging
  • ⚑ Smart update checking
  • πŸ—‘οΈ Easy uninstallation

Prerequisites

  • Termux from F-Droid
  • Termux:API from F-Droid
  • USB-C cable or OTG adapter + USB cable
  • Android device with USB debugging enabled

Installation

Quick Install (Recommended)

curl -s https://raw.githubusercontent.com/MaheshTechnicals/termux-adb/mt/install.sh | bash

Manual Install

# Clone repository
git clone -b mt https://github.com/MaheshTechnicals/termux-adb.git
cd termux-adb

# Make scripts executable
chmod +x install.sh uninstall.sh update.sh

# Run installer
./install.sh

What the installer does:

  • βœ“ Checks system requirements
  • βœ“ Updates package lists
  • βœ“ Installs dependencies (coreutils, gnupg, wget, curl)
  • βœ“ Adds termux-adb apt repository
  • βœ“ Installs GPG key for package verification
  • βœ“ Installs termux-adb and termux-fastboot
  • βœ“ Verifies installation
  • βœ“ Creates detailed log file

Updating

Check for Updates

./update.sh

Automatic Update via Package Manager

pkg upgrade

Any future upgrades will be done automatically as part of pkg upgrade.

Uninstallation

./uninstall.sh

This will:

  • Remove termux-adb package
  • Remove repository configuration
  • Remove GPG key
  • Clean up dependencies

Usage

Both termux-adb and termux-fastboot are drop-in replacements for the original commands so the usage is exactly the same. The commands were only renamed to avoid collision with the official android-tools Termux package (which contains more tools beside these two).

Basic Commands

# Check version
termux-adb version

# List connected devices
termux-adb devices

# Connect to device
termux-adb shell

# Install APK
termux-adb install app.apk

# Push/Pull files
termux-adb push local.txt /sdcard/
termux-adb pull /sdcard/file.txt

# Fastboot mode
termux-fastboot devices
termux-fastboot flash recovery recovery.img

Logs and Debugging

Installation and runtime logs are stored in:

$PREFIX/tmp/termux-adb-install.log
$PREFIX/tmp/termux-adb.*.log

For debug output:

RUST_LOG=debug termux-adb devices

Troubleshooting

Common Issues

Device not detected:

  • Ensure USB debugging is enabled on the target device
  • Check if termux-usb has permission to access the USB device
  • Try disconnecting and reconnecting the USB cable
  • Grant USB permission when prompted

Installation fails:

  • Check internet connection
  • Verify Termux has storage permission
  • Check logs in $PREFIX/tmp/termux-adb-install.log
  • Try running: pkg update && pkg upgrade first

Commands not found after installation:

  • Close and reopen Termux
  • Check if installed: which termux-adb
  • Verify PATH: echo $PATH

Getting Help

If you encounter issues:

  1. Check the log files in $PREFIX/tmp/
  2. Run with debug logging: RUST_LOG=debug termux-adb
  3. Open an issue with:
    • Output of termux-adb version
    • Output of pkg show termux-adb
    • Relevant log files
    • Device and Android version

Build Instructions

The official termux-packages build environment is used (forked to add the termux-adb package).

For more information, please refer to the Termux documentation:

Current limitations

Using termux-usb and querying device serial number with libusb tends to be slow. That's not a problem for adb which runs as a daemon and scans USB devices periodically. However, it is quite noticeable for termux-fastboot commands because fastboot doesn't use any background service. This can potentially be improved in a future release.

How it actually works

Termux has the android-tools package which contains adb and fastboot but it normally works on rooted devices only. This is mainly due to filesystem permissions required by adb when enumerating USB devices (traversing /dev/bus/usb/*).

There is, however, Android API exposed by termux-usb utility which gives you a raw file descriptor of any connected USB device after manual approval by the user.

Of course, adb by itself doesn't know anything about termux-usb nor it can take raw file descriptors from command-line or environment. If it cannot access /dev/bus/usb, it just won't detect any connected devices. This is where termux-adb comes in.

Both adb and fastboot are patched to scan for USB devices using the termux-usb command. Furthermore a Unix Domain Socket is used to transfer the obtained file descriptors from child process to the parent (i.e. termux-adb runs termux-usb for every detected device which in turn runs termux-adb in a special mode that will only send USB file descriptor to the UDS file descriptor provided by environment variable).

This way we don't complicate the user experience and we can work with any number of devices connected at once (e.g. if you have a USB hub connected to the OTG adapter).

Additional Tools πŸ› οΈ

Health Check

Check system status and diagnose issues:

./health-check.sh

This will verify:

  • Installation status
  • Dependencies
  • Repository configuration
  • USB device detection
  • ADB device connections
  • Permissions and logs

Update Checker

Check for and install updates:

./update.sh

Uninstaller

Complete removal of termux-adb:

./uninstall.sh

Changelog

See CHANGELOG.md for detailed version history.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support


Made with ❀️ for the Termux community

About

Run adb in Termux without root permissions!

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages