使用 scrcpy 连接 小米 或者 红米 手机的时候,会出现下列问题:
java.lang.SecurityException: Injecting input events requires the caller
(or the source of the instrumentation, if any)
to have the INJECT_EVENTS permission.
从官网的说明来看,其他手机型号是没有类似问题的,如图:
总结各网友给出的解决方法,需要注意两点:
第一,在开发者选项中,打开【USB 调试(安全设置)】。打开有一定风险,系统会确认多遍。如图:
第二,是USB连接上后,一定要选择文件传输,否则还是有错误。
以上方法,在 红米 K60 + 澎湃 1.0 上亲测有效。