Run adb and fastboot in Termux without root permissions!
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.
- π§ 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
- Termux from F-Droid
- Termux:API from F-Droid
- USB-C cable or OTG adapter + USB cable
- Android device with USB debugging enabled
curl -s https://raw.githubusercontent.com/MaheshTechnicals/termux-adb/mt/install.sh | bash# 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- β 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-adbandtermux-fastboot - β Verifies installation
- β Creates detailed log file
./update.shpkg upgradeAny future upgrades will be done automatically as part of pkg upgrade.
./uninstall.shThis will:
- Remove termux-adb package
- Remove repository configuration
- Remove GPG key
- Clean up dependencies
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).
# 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.imgInstallation and runtime logs are stored in:
$PREFIX/tmp/termux-adb-install.log
$PREFIX/tmp/termux-adb.*.logFor debug output:
RUST_LOG=debug termux-adb devicesDevice not detected:
- Ensure USB debugging is enabled on the target device
- Check if
termux-usbhas 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 upgradefirst
Commands not found after installation:
- Close and reopen Termux
- Check if installed:
which termux-adb - Verify PATH:
echo $PATH
If you encounter issues:
- Check the log files in
$PREFIX/tmp/ - Run with debug logging:
RUST_LOG=debug termux-adb - Open an issue with:
- Output of
termux-adb version - Output of
pkg show termux-adb - Relevant log files
- Device and Android version
- Output of
The official termux-packages build environment is used (forked to add the termux-adb package).
For more information, please refer to the Termux documentation:
- https://github.com/termux/termux-packages/wiki/Build-environment
- https://github.com/termux/termux-packages/wiki/Building-packages
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.
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).
Check system status and diagnose issues:
./health-check.shThis will verify:
- Installation status
- Dependencies
- Repository configuration
- USB device detection
- ADB device connections
- Permissions and logs
Check for and install updates:
./update.shComplete removal of termux-adb:
./uninstall.shSee CHANGELOG.md for detailed version history.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Original project by nohajc
- Built on top of termux-packages
- Uses patched Android platform tools
- π Report Issues
- π¬ Discussions
- π Wiki
Made with β€οΈ for the Termux community