Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see USB device in termux-adb devices #31

Closed
Damglador opened this issue Sep 23, 2024 · 7 comments
Closed

Can't see USB device in termux-adb devices #31

Damglador opened this issue Sep 23, 2024 · 7 comments

Comments

@Damglador
Copy link

Damglador commented Sep 23, 2024

Describe the bug
Device is connected, I can look up it's folders and stuff, adb is enabled, adb message is visible in the notifications on other device, device is visible in termux-usb, but termux-adb devices displays nothing. Am I doing something wrong?

To Reproduce
Steps to reproduce the behavior: connect a device to other device with a USB cable. In my case its USB-C to USB-A port and from USB-A port its USB-A to microUSB cable

Expected behavior
Idk, show a device, maybe that's just my skill issue

Smartphone (thing that does adb):

  • Device: Ulefone Armor 21
  • Android version: Android 14

Smartphone (thing that receives adb):

  • Device: ZTE Blade V8 Mini
  • Android version: Android 7 (a bit ancient 💀)

The Things:

Package: android-tools                          Version: 35.0.2
Maintainer: @termux                             Installed-Size: 12.8 MB
Depends: abseil-cpp, brotli, libc++, liblz4, libprotobuf, pcre2, zlib, zstd
Homepage: https://developer.android.com/        Download-Size: 2020 kB
APT-Manual-Installed: yes
APT-Sources: https://grimler.se/termux/termux-main stable/main aarch64 Packages                 Description: Android platform tools
Android Debug Bridge version 1.0.41             Version 34.0.4-android-tools
Installed as /data/data/com.termux/files/usr/bin/termux-adb
Running on Linux 5.10.205-android12-9-00027-g4d6c07fc6342-ab11525972 (aarch64)

adb.10209.log.zip

Additional context
A little demonstration:

~ $ termux-usb -l
[                                               
  "/dev/bus/usb/002/004"
]
~ $ termux-adb devices                          List of devices attached                        
~ $

Photo of adb message on the other phone (it's all in Ukrainian, but it says that debugging is enabled, proof: trust be bro)
IMG_20240924_000140_062.jpg

I tried doing termux-adb usb, but it just says:

~ $ termux-adb usb
error: no devices/emulators found

sudo doesn't seem to change anything.

@Damglador Damglador changed the title Can't see USB device Can't see USB device in termux-adb devices Sep 23, 2024
@Damglador
Copy link
Author

Btw adb itself works. I can self-adb my phone without a problem using local-wireless debugging

~ $ termux-adb shell cmd package list users
Users:
        UserInfo{0:Damglador:4c13} running

Achieved this with the script:

#!/data/data/com.termux/files/usr/bin/sh
adb devices
su -c "setprop service.adb.tcp.port 5555"
su -c "stop adbd"
su -c "start adbd"
sleep 5
adb connect localhost:5555

The thing for self-debugging wasn't "active" during attempts to debug other phone.

@Damglador
Copy link
Author

I've tested adb with the same phone and cable setup on my laptop, and it can see the phone as unauthorized and prompts to authorize the laptop on the phone

@Damglador
Copy link
Author

ALSO. I installed aShell You from F-Droid (IzzyDroid repo I think) and it also works perfectly with the same setup

@Damglador
Copy link
Author

After further testing, it got it, kinda. After some time since I connect the device Termux:API asks permission to device, but the device itself shows in termux-adb only after a couple of minutes. In aShell You it shows instantly. Maybe its a Termux:API issue.

@nohajc
Copy link
Owner

nohajc commented Sep 25, 2024

ALSO. I installed aShell You from F-Droid (IzzyDroid repo I think) and it also works perfectly with the same setup

I’m not actually familiar with that app. Does it work for you as an alternative?

I’m sorry to hear about these delays…
From what you describe it seems the termux-adb part is fine. Unfortunately, there’s not much I can do about the issue.

It would be interesting to try and write a native Android app which taps into the USB APIs directly. Is that what aShell You does? I’m not sure.

The whole linux userspace emulation layer in Termux can potentially add its own problems.

Anyway, it’s unlikely that I would start such a project in the near future.

@Damglador
Copy link
Author

aShell You: https://github.com/DP-Hridayan/aShellYou
It's only for ADB, console output is... not good, but not bad either and switching to it every time is not convenient. Maybe waiting a minute is not that big of a deal.

@Damglador
Copy link
Author

So more details:
After a device connects, or after adb start if it wasn't at the time of connection, termux-api seems to do nothing for a whole minute, precisely. After that device shows in adb devices and commands work without any delay. Since even other built-in termux-api commands have the same issue, termux-api issue it is.

Issue report on termux-api repo: termux/termux-api#714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants