4

In scrcpy documentation an OTG mode is mentioned. How is that working without adb and what can we do with that?

2
  • 1
    @MorrisonChang so scrcpy emulates HID. one question remains, can we use it to mirror screen without usb-debugging? or even better, to enable usb-debugging? because on android devices adb with OTG afaik not possible at same time
    – alecxs
    May 1, 2023 at 5:25
  • 1
    I'm not sure if you commented on the right post, but Morrison Chang won't receive the notification from your comment on your own post.
    – Andrew T.
    May 1, 2023 at 5:55

1 Answer 1

5

Which version of scrcpy OTG mode supported

It appears that version 1.24 is when it became available, but the latest version of scrcpy is probably preferred.

From: https://github.com/Genymobile/scrcpy/issues/3654#issuecomment-1369369005

How does scrcpy OTG mode work

From: https://github.com/Genymobile/scrcpy/issues/3662#issuecomment-1374404072

Nope, HID events are generated on mouse events received by SDL from X11/Wayland/…

So a desktop environment is required for operation.

Additionally,

From: https://github.com/Genymobile/scrcpy/issues/4341#issuecomment-1754765403

Scrcpy uses HID over Android Open Accessory, so there's no way it can work on iPhone.

Some more details are in the HID-OTG docs:

https://github.com/Genymobile/scrcpy/blob/master/doc/hid-otg.md

Beware that Windows may require certain USB driver configurations

As called out in: https://github.com/Genymobile/scrcpy/issues/3654#issuecomment-1369295011 and https://github.com/Genymobile/scrcpy/issues/3654#issuecomment-1369372860

The summarized version is that you may need to uninstall other ODM usb drivers and install Google's USB driver package.

What about mirroring the display without developer mode?

Display mirroring requires developer mode to be enabled as scrcpy:

The application executes a server on the device. The client and the server communicate via a socket over an adb tunnel.

The server streams an H.264 video of the device screen. The client decodes the video frames and displays them.

From the authors blog post: https://blog.rom1v.com/2018/03/introducing-scrcpy/

Without developer mode enabled, the PC can't copy the video server binary to the Android device.

More details on the scrcpy developer page

So what does this mean for devices with broken screens?

If you can get the Android device to connect over USB (i.e. driver issues with Windows) you may be able to use scrcpy --otg to enter pin / enable developer mode. While you will have a better chance if it is just the screen capacitive touch sensors that are damaged so you can see what is being enabled, if the screen is completely broken, it is the same problem with plugging in a keyboard/mouse as you are blind to what is going on.

3
  • You can use OTG mode to enable ADB on the device but it seems like the phone does not recognize the PC at that time as ADB client, so the ADB authorization dialog does not show up (at least not in my tests).
    – Robert
    Oct 12, 2023 at 9:37
  • @Robert Thanks for the feedback. I'm wondering if you are able to enable Bluetooth keyboard/mouse and using those get through the ADB authorization dialog. Oct 12, 2023 at 12:30
  • In theory yes, but in reality even on a phone with fully working screen and touch it is a challenge to open the settings menu, go to Connected devices and start the pairing sequence.
    – Robert
    Oct 12, 2023 at 12:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .