Skip to content

Commit

Permalink
Document INJECT_EVENTS permission issue on Xiaomi
Browse files Browse the repository at this point in the history
Make explicit in the prerequisites the exact error message when "USB
debugging (Security Settings)" is not set.
  • Loading branch information
rom1v committed Aug 2, 2024
1 parent 67f9335 commit 992b492
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ Make sure you [enabled USB debugging][enable-adb] on your device(s).

[enable-adb]: https://developer.android.com/studio/debug/dev-options#enable

On some devices, you also need to enable [an additional option][control] `USB
debugging (Security Settings)` (this is an item different from `USB debugging`)
to control it using a keyboard and mouse. Rebooting the device is necessary once
this option is set.
On some devices (especially Xiaomi), you might get the following error:

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

In that case, you need to enable [an additional option][control] `USB debugging
(Security Settings)` (this is an item different from `USB debugging`) to control
it using a keyboard and mouse. Rebooting the device is necessary once this
option is set.

[control]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323

Expand Down

0 comments on commit 992b492

Please sign in to comment.