-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Regarding the necessity of killing the adb service in the otg mode on Windows platform #4028
Comments
I think there is a better way to solve this problem, see #4034 |
eh~This does seem like a more elegant solution. But are you sure this can be done via ADB without installing any app on the device? Sorry I don't know much about how to call Linux Api on Android devices |
我有个安卓项目,测试了确实可以这么做的 |
是的,亲测是没问题的,我写了个虚拟HID手柄的程序,用adb就可以成功创建HID手柄 |
Hi, Please keep talking in English ;)
Maybe adding an option ( This can be done regardless of what is done about #4034. |
Adding an option is certainly simpler, but the method mentioned by #4034 can use USB connection to mirroring device and use HID emulation at the same time, without requiring adb use tcp connection. Both functions are done through adb. I think #4034 method is better when we are capable enough. Maybe we can do #4032 first, and then consider whether #4034 is easy to complete. What do you think? And I am happey to contribute code for #4032. |
I have already done the native code and it can be ported and built at any time. I will upload it within a few minutes. |
Ok, little embarrassed. Looking forward to your submission,I will study it. |
|
so is it now possible to use OTG HID and mirror on Windows at the same time? |
Yes it is possible |
Also see #4473. |
aaaww, that's sad news for me. I tried using the UHID and SDK, it just doesn't work. the app won't capture the mouse and keyboard. but for normal mirroring, UHID and SDK does work normally. will it be possible if I fire up a Ubuntu VM and use scrcpy inside it? I mean, will I be able to mirror and use OAOv2 mouse and keyboard? |
Regarding the necessity of killing the adb service in the otg mode on Windows platform
We can not use HID and mirror mode on Windows platform beacuse Windows not possible to open a USB device by more than one process, and mirror mode will invoke adb server to connect device. Adb will open our Android USB device.
But really ?
In fact, I managed to use the HID at the same time with the mirroring screen turned on successfully, on Windows platform, used scrcpy.
The key to the way is to use the remote debugging feature of adb, so that adb does not need to use USB to connect the device
First, we open a scrcpy
script.exe --otg -K
I will kill adb server and conncet to device, simulate HID input.
Then, we open another scrcpy, use TCP/IP to connect the device
script.exe --tcpip=192.168.12.34:5678
If all goes well, you can now have HID input while mirroring is enabled
My soluction: try connect to device by usb first?
My mind is, on OTG mode, try to make a connection to the device first instead of killing adb first, If the connection fails, it is not too late to try to kill adb.
On mirror mode, if user use tcpip to connect to device, maybe we can allow simultaneous HID input from the user.
I am proud to contribute code
If you think what I'm saying makes sense, I'd be happy to contribute code to complete this functionality. <( ̄︶ ̄)↗[GO!]
The text was updated successfully, but these errors were encountered: