-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Correctly handle USB attach of Android device in USB debugging mode #5717
Comments
This appears to be a recentish regression. This definitely worked at some point. A few months ago I think? (I can also reproduce this issue; I ran into #5701 while diagnosing the problem reported here, but I never followed up.) |
This indeed worked with Android 9, but with Android 10 it's gone again. |
A workaround is to run adb in sys-usb and use it over rpc. Obviously not ideal, but until there's a better solution: In dom0 /etc/qubes-rpc/policy/qubes.ConnectTCP In sys-usb, install adb or copy it from your Android Studio install (works best if this is the same version that Android Studio is expecting). Then make sure sys-usb can see your device In "android" vm, increase xen_gntalloc limit to prevent ioctl errors (put this in your /rw/config/rc.local for your convenience): make sure Android Studio is closed, and no adb server is running, then run Now you should be able to use adb like normal. Whenever you close Android Studio or issue a |
The other workaround would be passing a different usb controller to the adb qube, to not run anything in sys-usb and avoid any risk (even if small). If there's a single one in the system maybe a usb PCI card will do the job. |
@n0madK Neat, I might try that out. My workaround for the time being has been:
However, the latency and bandwidth is not great, so your solution sounds better for a long-term fix. @ejose19 Also interesting, but I'm on a laptop, so no PCI slots. |
the path for above should be HTH |
Yes, of course. |
Apologies, corrected the typo |
I have trouble to use the workaround. Now, if I execute "adb devices" inside android-access-vm, it reports However, that new adb instance doesn't work. Running adb devices inside android-access-vm again gives me "socat ... connection refused", child exited, error protocol fault. What is my mistake? |
Any update on this? This makes Android development and debugging quite hard if possible at all. Thet network workarounds haven't worked for me |
Any update? |
usbip redirects whole USB port, not just the currently attached device. I've found this to work just fine in this particular use case. |
The problem you're addressing (if any)
As discussed in the closed issue ticket here: #2202
Android devices in debugging mode (ie: for Android app development) cannot be attached to a VM.
Describe the solution you'd like
Provide a way to connect the Android device while in USB debugging mode. Even a special-case script or some kind of config option would be better than nothing.
Where is the value to a user, and who might that user be?
Android developers can use Qubes for work.
Describe alternatives you've considered
There is an ADB over TCP workaround, but this is not ideal, and also requires that the user be connected to a network.
EDIT: This workaround isn't even feasible on most Android devices, as the
ADB over network
setting is not exposed via any UI, and must be activated by a shell command via ADB. So, you still need a working USB ADB connection in order to hand over to WiFi ADB. Additionally, this setting reverts when the phone is rebooted, making it impossible to "set and forget."Related, non-duplicate issues
#2202
The text was updated successfully, but these errors were encountered: