@flipphoneguy I installed android-tools package, and trying to adb another device, but adb devices returns a blank list and no auth prompt comes up on the other phone
adb only works with root. There is a package that’s meant to make it work without root (I forgot the name. It’s in the pkgs and from GitHub) but in my experience that one what only worked with root. But it might work for you
I have root. When I su it can’t access the package and sudo/tsu says no superuser binary detected and asks if I’m rooted
What do you get when you do which su?
What root to you have - magisk?
/data/data/com.termux/files/usr/bin/su
Magisk from 6.1.3
That’s just the termux wrapper
@ars18 did you hide the binary somewhere weird?
After you find the actual binary, pkg install sudo (I dunno if tsu supports it and sudo is anyway better) and then sudo --su-path= (replace with the path you find the actual su binary is) don’t l should work
It’s extremely useful to have sudo and not just su cuz su uses the stock Android shell while sudo keeps your termux path with all it’s installed pkgs
Ik
But no clue where the binary is…
Also su takes me to the termux wrapper…?
Chatgpt:
Termux sudo does not preserve your Termux environment the way Linux sudo does, and it definitely does not magically keep you in the same user context with full access to Termux packa
Also sudo --su-path=xxxxx also returns no superuser binary
I just checked. The su command in termux is a tiny wrapper that looks for su, sets the PATH variable and executes it.
This is it:
#!/data/data/com.termux/files/usr/bin/sh
unset LD_LIBRARY_PATH LD_PRELOAD
for p in /debug_ramdisk/su /sbin/su /system/sbin/su /system/bin/su /system/xbin/su /su/bin/su /magisk/.core/bin/su
do
if [ -x $p ]; then
# The su tool may require programs in PATH:
PATH=/debug_ramdisk:/sbin:/sbin/su:/su/bin:/su/xbin:/system/bin:/system/xbin \
exec $p "$@"
fi
done
echo "No su program found on this device. Termux"
echo "does not supply tools for rooting, see e.g."
echo "http://www.androidcentral.com/root for"
echo "information about rooting Android."
exit 1
So if that works for you, try running this
for p in /debug_ramdisk/su /sbin/su /system/sbin/su /system/bin/su /system/xbin/su /su/bin/su /magisk/.core/bin/su
do
if [ -x $p ]; then
echo $(realpath "$p")
fi
done
Tell chatgpt I say he’s wrong ![]()
Facts: sudo absolutely does keep the path variable with access to all your termux packages. I use it daily. Read the manual. Read the help. Test it.
The --su-path option I never tried but it’s what comes up in the -h to skip searching for the binary
Uhh how do I run that…
Click copy, open termux, long press anywhere and click paste and then click enter
/debug_ramdisk/magisk
That’s how it should be able very weird that sudo isn’t catching it. Try sudo --su-path=/debug_ramdisk/su id
Now what
Okay I figured it out. I had the wrong sudo package, no clue how
But I got it now
Only thing would still like to know, sudo adb says no command like that, I have to do sudo so adb… Why
Sudo so? There’s no so command
Sudo su* then adb
Nevermind it works now … Weird
Enjoy the power of sudo with termux!!