Genymobile / Genymobile/scrcpy

Regarding the necessity of killing the adb service in the otg mode on Windows platform

Open
#4,028 14 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [ yes ] I have checked that a similar [feature request](https://github.com/Genymobile/scrcpy/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) does not already exist.

**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

![20230523202813](https://github.com/Genymobile/scrcpy/assets/46065109/256163d1-d3b2-4316-bf36-4aedb431d3dd)

**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!]

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the OTG startup and TCP/IP connection flows described in the issue, focusing on when the adb service is contacted or stopped on Windows. Confirm the intended behavior with maintainers and define tests for USB HID plus mirroring over remote debugging; done means the agreed simultaneous modes work without disrupting existing OTG behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
desktop-dev, mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.