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

AOA keyboard and mouse throught USB and adb debugging throught TCP/IP #5343

Closed
baco81 opened this issue Oct 4, 2024 · 5 comments
Closed

Comments

@baco81
Copy link

baco81 commented Oct 4, 2024

Environment

  • Operating System (OS): Windows 10
  • Scrcpy Version: 2.7
  • Installation Method: manual
  • Device Model: Samsung Galaxy Tab A9+
  • Android Version: 14

Describe the bug

Sorry if this is reported somewhere else, newbie here. I am trying to use scrcpy with the following prompt:

@echo off
scrcpy.exe --select-tcpip --keyboard=aoa --mouse=aoa --no-video --no-audio --pause-on-exit=if-error %*

But I get the following errors:

ERROR: On Windows, it is not possible to open a USB device already open by another process (like adb).
ERROR: Therefore, --keyboard=aoa and --mouse=aoa may only work in OTG mode (--otg).

What I am trying to achieve is to use the AOA protocol for the keyboard and mouse through USB to control the device, while maintaining ADB debugging through TCP/IP. From my limited understanding, It should be technically possible.

I have tried passing the OTG argument and it is working fine, but I need other functions as clipboard synching that would require adb debugging.

Currently, I use both Samsung Flow for clipboard syncing and scrcpy for controlling the keyboard and mouse with OTG, which achieves the desired result. 

It would be nice and more convenient though if I could just use scrcpy for clipboard synching as well, making it a single solution for both tasks.

Thank you very much for your time.

@rom1v
Copy link
Collaborator

rom1v commented Oct 5, 2024

@baco81
Copy link
Author

baco81 commented Oct 5, 2024

Thank for your answer.
I have tried uhid, but I found it less convenient than my current setup. The reason is that with OTG I am able to "wake up" the device when its screen has gone black, but I can't if using uhid instead. That forces me to wake the device first to be able to control it with the mouse and keyboard every time. And I don't want to use the always on argument, as I don't want my device screen to be always awake.

@rom1v
Copy link
Collaborator

rom1v commented Oct 5, 2024

The reason is that with OTG I am able to "wake up" the device when its screen has gone black, but I can't if using uhid instead

On Android, it is true that AOA wakes up the device when moving the mouse.

But scrcpy supports waking up the device with right-click or Shift+right-click in any case: https://github.com/Genymobile/scrcpy/blob/master/doc/mouse.md#mouse-bindings

@baco81
Copy link
Author

baco81 commented Oct 5, 2024

But scrcpy supports waking up the device with right-click or Shift+right-click in any case: https://github.com/Genymobile/scrcpy/blob/master/doc/mouse.md#mouse-bindings

I didn't know that. I have tried it and, while I still find more "natural" and straightforward to wake up the device by just moving the mouse, it works good enough. Thank you very much!!

As per my original request, I have tried running two scrcpy instances, one with aoa for the keyboard and mouse through USB and another one for ADB debugging through TCP/IP but for some reason I can't it get to work (at least, on Windows).

Anyway, I think this "issue" can be closed as I can just use shift+right-click while in uihd mode as suggested. Thank you again for your time.

@rom1v
Copy link
Collaborator

rom1v commented Oct 5, 2024

As per my original request, I have tried running two scrcpy instances, one with aoa for the keyboard and mouse through USB and another one for ADB debugging through TCP/IP but for some reason I can't it get to work (at least, on Windows).

Refs #4028 #4032 #4035

@rom1v rom1v closed this as completed Oct 5, 2024
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