Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
106.44k stars 10.31k forks source link

scrcpy not accepting input from keyboard / mouse. #4941

Open KashifSaeed5c opened 2 months ago

KashifSaeed5c commented 2 months ago

Thank you for the scrcpy version win64 2.4

running file scrcpy and displays the mobile mirror. However when i click on mirror screen to operate mobile from computer it does not show any activity on mobile.

in earlier version win64 2 it was working fine and i was able to use mobile from computer.

Please support, its very good solution if works.

KashifSaeed5c commented 2 months ago

Error also shows in console, refer attached screenshot. ![Uploading scrcpy error.JPG…]()

KashifSaeed5c commented 2 months ago
    ... 10 more

[server] ERROR: Could not invoke method java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputManager.java:58) at com.genymobile.scrcpy.Device.injectEvent(Device.java:230) at com.genymobile.scrcpy.Device.injectEvent(Device.java:234) at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:362) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:162) at com.genymobile.scrcpy.Controller.control(Controller.java:97) at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:105) at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda1.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission. at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at android.hardware.input.IInputManager$Stub$Proxy.injectInputEventToTarget(IInputManager.java:1590) at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1217) at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1227) ... 10 more [server] ERROR: Could not invoke method java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputManager.java:58) at com.genymobile.scrcpy.Device.injectEvent(Device.java:230) at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:241) at com.genymobile.scrcpy.Device.pressReleaseKeycode(Device.java:249) at com.genymobile.scrcpy.Device.pressReleaseKeycode(Device.java:254) at com.genymobile.scrcpy.Controller.pressBackOrTurnScreenOn(Controller.java:412) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:172) at com.genymobile.scrcpy.Controller.control(Controller.java:97) at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:105) at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda1.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission. at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at android.hardware.input.IInputManager$Stub$Proxy.injectInputEventToTarget(IInputManager.java:1590) at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1217) at android.hardware.input.InputManagerGlobal.injectInputEvent(InputManagerGlobal.java:1227) ... 12 more Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.input.InputManagerService.injectInputEventToTarget(InputManagerService.java:925) at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:752) at android.os.Binder.execTransactInternal(Binder.java:1346) at android.os.Binder.execTransact(Binder.java:1282)

rom1v commented 2 months ago

Caused by: java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.

Please read https://github.com/Genymobile/scrcpy#prerequisites