Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.58k stars 10.45k forks source link

Enabled USB Debug Security settings and restarted but Poco F5 but still cannot interact with POCO F5 Phone #4690

Open MacroHard-Winux opened 6 months ago

MacroHard-Winux commented 6 months ago

Environment

Describe the bug I have enabled "USB debugging (Security settings)" in devloper option but still cannot control the phone with keybaord and mouse

Things I have tried I did restart after enabling the setting Disable USB debugging and enable everything again Disable Developer option and enable everything again

qt.qpa.xcb: QXcbConnection: XCB error: 14 (BadIDChoice), sequence: 381, resource id: 1, major code: 53 (CreatePixmap), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 382, resource id: 1, major code: 55 (CreateGC), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 383, resource id: 1, major code: 72 (PutImage), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 13 (BadGC), sequence: 384, resource id: 106954761, major code: 60 (FreeGC), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 385, resource id: 1, major code: 139 (Unknown), minor code: 4
qt.qpa.xcb: QXcbConnection: XCB error: 4 (BadPixmap), sequence: 386, resource id: 1, major code: 54 (FreePixmap), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 143 (Unknown), sequence: 387, resource id: 106954762, major code: 139 (Unknown), minor code: 27
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 391, resource id: 106954763, major code: 138 (Unknown), minor code: 23
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 392, resource id: 106954763, major code: 138 (Unknown), minor code: 23
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 393, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 394, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 457, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 458, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 544, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 566, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 575, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
WARNING:guiscrcpy.adb:Command '['/tmp/.mount_guiscrVGUgS2/scrcpy/usr/bin/adb', '-s', '192.168.31.89:5555', 'shell', 'wm', 'size']' exited with '1'
E: guiscrcpy has crashed because of a failure in the execution of `adb shell wm size`. This might be because of an improper connection of adb. Please reconnect your device (disconnect from WiFi / Reconnect USB) or try 

guiscrcpy --killserver

as a command line to restart adb server
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 683, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 684, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
scrcpy 1.25 <https://github.com/Genymobile/scrcpy>
/tmp/.mount_guiscrVGUgS2/scrcpy/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 55.8 MB/s (42151 bytes in 0.001s)
[server] INFO: Device: Xiaomi 23049PCD8G (Android 14)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.addPrimaryClipChangedListener [interface android.content.IOnPrimaryClipChangedListener, class java.lang.String, class java.lang.String, int]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getAddPrimaryClipChangedListener(ClipboardManager.java:128)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.addPrimaryClipChangedListener(ClipboardManager.java:138)
        at com.genymobile.scrcpy.Device.<init>(Device.java:100)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:64)
        at com.genymobile.scrcpy.Server.main(Server.java:334)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:368)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
INFO: Trilinear filtering enabled
ERROR: Could not open image codec: /usr/local/share/icons/hicolor/256x256/apps/scrcpy.png
WARN: Could not load icon
INFO: Initial texture: 1080x2400
[server] ERROR: Exception on thread Thread[Thread-2,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:75)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:192)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:196)
        at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:231)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:102)
        at com.genymobile.scrcpy.Controller.control(Controller.java:79)
        at com.genymobile.scrcpy.Server$3.run(Server.java:132)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:72)
        ... 7 more
Caused by: java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:207)
        at android.hardware.input.InputManager.getInstance(InputManager.java:271)
        ... 9 more
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 797, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 6 (BadCursor), sequence: 892, resource id: 106954763, major code: 2 (ChangeWindowAttributes), minor code: 0
WARN: Killing the server...

Please do not post screenshots of your terminal, just post the content as text instead. image

rom1v commented 6 months ago
scrcpy 1.25 <https://github.com/Genymobile/scrcpy>

Way too old. Install the latest version.

warrenc5 commented 5 months ago

I'm also getting this. I can see the screen but can't click on any buttons. I checked in settings - I have no option USB debugging (Security Settings)

Thank you.


[server] INFO: Device: OnePlus CPH2415 (Android 14)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.addPrimaryClipChangedListener [interface android.content.IOnPrimaryClipChangedListener, class java.lang.String, class java.lang.String, int]
    at java.lang.Class.getMethod(Class.java:2937)
    at java.lang.Class.getMethod(Class.java:2449)
    at com.genymobile.scrcpy.wrappers.ClipboardManager.getAddPrimaryClipChangedListener(ClipboardManager.java:128)
    at com.genymobile.scrcpy.wrappers.ClipboardManager.addPrimaryClipChangedListener(ClipboardManager.java:138)
    at com.genymobile.scrcpy.Device.<init>(Device.java:100)
    at com.genymobile.scrcpy.Server.scrcpy(Server.java:64)
    at com.genymobile.scrcpy.Server.main(Server.java:334)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:379)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.1-1
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2408
[server] ERROR: Exception on thread Thread[Thread-2,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
    at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:75)
    at com.genymobile.scrcpy.Device.injectEvent(Device.java:192)
    at com.genymobile.scrcpy.Device.injectEvent(Device.java:196)
    at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:231)
    at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:102)
    at com.genymobile.scrcpy.Controller.control(Controller.java:79)
    at com.genymobile.scrcpy.Server$3.run(Server.java:132)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:72)
    ... 7 more
Caused by: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:207)
    at android.hardware.input.InputManager.getInstance(InputManager.java:271)
    ... 9 more
[server] ERROR: Encoding error: java.lang.IllegalStateException: Pending dequeue output buffer request cancelled
rom1v commented 5 months ago

Upgrade to the latest version of scrcpy.

warrenc5 commented 5 months ago

Using adb logcat | grep scrcpy I curiously see

03-21 09:30:10.829 2172 2172 D Layer : reparent to null sequence=619, seq[1], name=Display 5 name="scrcpy"#619 03-21 09:30:10.832 23546 23546 W ziparchive: Unable to open '/data/local/tmp/scrcpy-server.dm': No such file or directory

I previously (today) ran an old version of scrcpy from snap using debian apt install potentially giving me this issue https://github.com/Genymobile/scrcpy/issues/1746

warrenc5 commented 5 months ago

Thank you. I had previously ran install_release.sh

I have rebooted phone and cleared out the tmp directory.

Something is stuck.

SCRCPY_SERVER_PATH=scrcpy-server scrcpy
scrcpy 1.25 <https://github.com/Genymobile/scrcpy>
scrcpy-server: 1 file pushed, 0 skipped. 234.3 MB/s (69007 bytes in 0.000s)
[server] ERROR: The server version (2.4) does not match the client (1.25)
java.lang.IllegalArgumentException: The server version (2.4) does not match the client (1.25)
    at com.genymobile.scrcpy.Options.parse(Options.java:237)
    at com.genymobile.scrcpy.Server.internalMain(Server.java:231)
    at com.genymobile.scrcpy.Server.main(Server.java:214)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:379)
ERROR: Server connection failed
warrenc5 commented 5 months ago

During install_release it downloaded the scrcpy-server I understand this is an android application and is sideloaded onto the device automatically when running scrcpy (client)

warrenc5 commented 5 months ago

Ok - problem solved.

I still had not properly apt remove scrcpy. apt remove -P scrcpy.

Everything now works perfectly with 1.25.

Sorry and thank you.