Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
103.02k stars 10.01k forks source link

scrcpy on Nothing 2a / macOS works, but with weird errors #4878

Closed freebrowser1 closed 3 weeks ago

freebrowser1 commented 3 weeks ago

Environment

Describe the bug When I connect my Nothing 2a with scrcpy, it does show the screen on the computer and does accept 'normal' keystrokes and mouse actions. I was using scrcpy over wifi and it was not connected via USB to the computer. But /

mymac:~/scratch % scrcpy -S -s 192.168.1.9 -m 1024 -K
scrcpy v2.2 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)  192.168.1.9:5555                device  A142
/usr/local/bin/homebrew/Cellar/scrcpy/2.2/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 43.7 MB/s (64363 bytes in 0.001s)
[server] INFO: Device: [Nothing] Nothing A142 (Android 14)
ERROR: Could not find USB device 192.168.1.9:5555
ERROR:         8204C660           (046d:0825)  (null) C270 HD WEBCAM
ERROR:         0000000000000001   (2109:0100)  VIA Technologies Inc.          USB 2.0 BILLBOARD             
ERROR:         000001             (0bda:8153)  Realtek USB 10/100/1000 LAN
ERROR: Fallback to default keyboard injection method (-K/--hid-keyboard ignored)
INFO: Renderer: metal
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.view.SurfaceControl.getPhysicalDisplayIds []
    at java.lang.Class.getMethod(Class.java:2937)
    at java.lang.Class.getMethod(Class.java:2449)
    at com.genymobile.scrcpy.wrappers.SurfaceControl.getGetPhysicalDisplayIdsMethod(SurfaceControl.java:137)
    at com.genymobile.scrcpy.wrappers.SurfaceControl.getPhysicalDisplayIds(SurfaceControl.java:144)
    at com.genymobile.scrcpy.Device.setScreenPowerMode(Device.java:319)
    at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:169)
    at com.genymobile.scrcpy.Controller.control(Controller.java:83)
    at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:91)
    at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda1.run(Unknown Source:4)
    at java.lang.Thread.run(Thread.java:1012)
[server] ERROR: Could not get physical display ids
INFO: Texture: 1024x456
rom1v commented 3 weeks ago

scrcpy v2.2 https://github.com/Genymobile/scrcpy

Upgrade to the latest version (currently 2.4, which is the current version in homebrew).

freebrowser1 commented 3 weeks ago

Indeed, you are right, before I did this I called brew upgrade scrcpy, but presumably it did not update. On another Mac (a Macbook Pro M1) the app worked flawlessly with the same device.