
Si cuando conectamos nuestro dispositivo a Vysor o scrcpy (programas para proyectar la pantalla de nuestro dispositivo en el ordenador) resulta que no nos deja pulsar la pantalla con el ratón o nos aparece este error:
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:192) at com.genymobile.scrcpy.Device.injectEvent(Device.java:196) at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:320) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:134) at com.genymobile.scrcpy.Controller.control(Controller.java:83) at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:90) at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda0.run(Unknown Source:2) 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:3011) at android.os.Parcel.createException(Parcel.java:2995) at android.os.Parcel.readException(Parcel.java:2978) at android.os.Parcel.readException(Parcel.java:2920) at android.hardware.input.IInputManager$Stub$Proxy.injectInputEventToTarget(IInputManager.java:1294) at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1153) at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1182) ... 10 more Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.input.InputManagerService.injectInputEventToTarget(InputManagerService.java:916) at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:617) at android.os.Binder.execTransactInternal(Binder.java:1285) at android.os.Binder.execTransact(Binder.java:1249)
Debemos ir a opciones de desarrollador > Depuración por USB (opciones de seguridad)
Y activar esta última opción.

En Android antiguos no aparecerá esa opción, solo debemos tener activada Depuración por USB


Ingeniero en Informática, Investigador, me encanta crear cosas o arreglarlas y darles una nueva vida. Escritor y poeta. Más de 20 APPs publicadas y un libro en Amazon.