Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.87k stars 10.48k forks source link

Try to use OTG mode in linux Ubuntu but throw Access denied error #5252

Closed SHIHES closed 1 week ago

SHIHES commented 2 weeks ago

I'm trying to recovery my broken Samsung A40 by using OTG mode (can't use touch pad and display screen is broken) and I search the FAQ seems like using Linux system makes less issues. But when I use --otg command it shows the issue log as following with a tiny scrcpy default icon window. Could you plz give me some hints to solve it? Thank you so much!!

Had been turned on developer mode before

Yes

Environment

Android Version

Android 10

Linux Version
steven@LinuxUbuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy
Scrcpy Version
steven@LinuxUbuntu:~$ scrcpy --version
scrcpy 2.6.1 <[https://github.com/Genymobile/scrcpy](https://github.com/Genymobile/scrcpy?fbclid=IwZXh0bgNhZW0CMTAAAR3yxpjKQgKpsm2auPB-kyuwL6-hlMARJEC-_ZjBZXmttKcEuxX1Byx_YNQ_aem_rRL26zCzAb5-j4Ws-HQ42g)>

Dependencies (compiled / linked):
 - SDL: 2.0.20 / 2.0.20
 - libavcodec: 58.134.100 / 58.134.100
 - libavformat: 58.76.100 / 58.76.100
 - libavutil: 56.70.100 / 56.70.100
 - libavdevice: 58.13.100 / 58.13.100
 - libusb: - / 1.0.25

Issue Log

steven@LinuxUbuntu:~$ scrcpy --otg -Vdebug
scrcpy 2.6.1 <[https://github.com/Genymobile/scrcpy](https://github.com/Genymobile/scrcpy?fbclid=IwZXh0bgNhZW0CMTAAAR3NNWnJs9tZGwSDdiT-0XaD_ddteqmvaCyr451-fRhHQWGWMpzGeVvBsic_aem_S34IptteR0iElGdTn0UpMg)>
DEBUG: Open USB device 1d6b:0003: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 0bda:4852: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 1d6b:0002: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 0bda:8153: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 1d6b:0003: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 13d3:5419: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 2109:8817: libusb error: Access denied (insufficient permissions)
DEBUG: Open USB device 1d6b:0002: libusb error: Access denied (insufficient permissions)
INFO: USB device found:
INFO:     --> RF8MA2T5KWJ        (04e8:6860)  SAMSUNG SAMSUNG_Android
DEBUG: Starting AOA thread
DEBUG: Using icon: /usr/local/share/icons/hicolor/256x256/apps/scrcpy.png
DEBUG: User requested to quit
DEBUG: quit...
rom1v commented 2 weeks ago

But when I use --otg command it shows the issue log as following with a tiny scrcpy default icon window

So this works: the tiny scrcpy window is to capture mouse and keyboard events, they are injected to your Android device. Try with a non-broken phone to understand the behavior.

You enabled the debug mode, the "permission denied" are related to listing your USB devices on your computer (as listed by lsusb).

SHIHES commented 2 weeks ago

Thanks for your reply! I play the OTG mode a little bit on a normal phone. So it seems that I have to pass the screen code and the permission without watching the screen right? I even cannot use adb logcat to check the system log lol

rom1v commented 2 weeks ago

So it seems that I have to pass the screen code and the permission without watching the screen right?

https://github.com/Genymobile/scrcpy/issues/4914#issuecomment-2105635639

SHIHES commented 1 week ago

Although the command of comment is not for Samsung One UI, after practicing on my new phone for several days and try-and-error on my broken phone, I finally succeeded !!! Thank you so much, sir.