Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
105.6k stars 10.25k forks source link

Input functions is not working #4714

Open AjuAlex66 opened 4 months ago

AjuAlex66 commented 4 months ago

The program is not detecting any input events. Using the latest version of the program, tested on Android 14

[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:37) at com.genymobile.scrcpy.Device.injectEvent(Device.java:226) at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:237) at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:241) at com.genymobile.scrcpy.Controller.pressBackOrTurnScreenOn(Controller.java:360) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:148) 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) 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) ... 11 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 4 months ago

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

AjuAlex66 commented 4 months ago

there is no such an option on my phone.

rom1v commented 4 months ago

What is your device (as printed in the console, before the error)?

AjuAlex66 commented 4 months ago

@rom1v it's nothing phone(1)

notstyle commented 4 months ago

Same on Xiaomi 14, Android 14 UKQ1.230804.001

rom1v commented 4 months ago

@notstyle https://github.com/Genymobile/scrcpy#prerequisites

notstyle commented 4 months ago

@notstyle https://github.com/Genymobile/scrcpy#prerequisites

Thank you and sorry, my fail, not restarted phone after changes.