Closed AlphaBs closed 4 months ago
Hi, regarding the permission denied error, that's expected behavior. That's why termux-adb is needed in the first place. To work around this issue.
You can try running directly termux-usb -l
which is how Termux can enumerate usb devices and that's what I'm using under the hood.
If this gives you an empty result ([]
), I'm afraid it's beyond my control. I cannot verify if this is a breaking change caused by Android or just some sort of Samsung regression. The Termux devs might have more information.
termux-usb -l
shows my device as shown in the first screenshot.
Ah, sorry, I don't know how I missed that. It's interesting that from the log, it looks like termux-adb detects the device as well. Just doesn't show it... I'll investigate more.
Device is detected from the list but then it should also get its USB file descriptor and inject it to a simulated filesystem hierarchy (creating a fake file with the expected /dev/usb path). This doesn't happen for some reason. Could be that unix sockets (used for passing the descriptor) are somehow broken.
I'll think about how I could verify that assumption but I don't have Android 14 on any of my devices at the moment (none of them is Samsung either).
To further clarify, it could either be a problem with passing descriptors between processes (using Unix sockets) or with termux-usb itself (it could enumerate devices fine but still be unable to give you the device descriptor). Looking at the code, it seems it's probably the former.
Anyway, if I'm not able to reproduce it, I can write a simple program to test it on your device. Then we'll see.
With some changes to termux-adb I think I could even make it work without the sockets albeit with some limitations.
thank you for investigating. I'm willing to do your test.
Ok, so this is two tests in one: https://github.com/nohajc/termux-usb-test/releases/tag/0.1.0
I compiled the binary for ARM 64-bit (aarch64), hopefully that's correct.
Put this anywhere in termux, go to that directory and get your connected device path by running termux-usb -l
.
(Also run chmod +x ./termux-usb-test
if needed.)
First test - run termux-usb -e ./termux-usb-test -E -r /dev/bus/usb/001/002
(replacing path according to your case).
This should print the serial number of the device.
Second test - just run ./termux-usb-test --test-uds
.
This should also print the serial number with some additional logs but it may hang indefinitely if Unix sockets don't work correctly.
If you could post here the output of both runs, that would be super helpful.
it shows nothing..
I found that termux-usb -e <command> /dev/...
does not work with even very simple command like ls
, echo
. it shows nothing and it does not execute the command.
maybe the problem is termux-usb
.
I found https://github.com/termux/termux-api/issues/643
it was termux-api
...
Oh, that's interesting. Anyway, have you tried running it with the usual Samsung workaround? (ANDROID_NO_USE_FWMARK_CLIENT=1 fakeroot
). Tbh, I don't know if these are related to termux or just adb...
yes I've already tried but no luck
termux/termux-api#643 was fixed!
after installing nightly build of termux-api
, now adb devices
shows my device well.
Describe the bug
termux-adb devices
shows nothing after upgrading my device to Android 14To Reproduce![Screenshot_20240209_145139_Termux](https://github.com/nohajc/termux-adb/assets/17783561/feafc449-a024-4379-883b-edada1e64915)
Expected behavior shows connected device
Smartphone (please complete the following information):
Attach output of the following commands
RUST_LOG=debug ./termux-adb
(run with debug logs enabled)pkg show android-tools
(show package info)adb version
(show adb version)Attach contents of the following files (after running with debug logs enabled)
/data/data/com.termux/files/usr/tmp/adb.10233.log
/data/data/com.termux/files/usr/tmp/termux-adb.10233.log
adb.0.log
Additional context![Screenshot_20240209_150751_Termux](https://github.com/nohajc/termux-adb/assets/17783561/73323b52-9f16-469e-afaa-deef20dae34e)
In the log adb were trying to open directory
/dev/bus/usb
, but it seems the permission is denied, eventermux-usb /dev/bus/usb/002/005
shows access granted.before upgrading I can connect to my android tablet without any problem. and I can still connect to my tablet using my second device (android 13).