设备:小米12S(Android 13)
我将手机连接到电脑进行USB调试,我正在尝试使用cmd命令来模拟手机上的点击:
adb shell input swipe 447 572 447 572 737
然后出现错误:
Exception occurred while executing 'swipe':
java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
我的设备上没有发生点击事件。
我尝试在 stackoverflow 中寻找类似的问题:
Android INJECT_EVENTS 权限(Android 13)
但是这个问题的解决方案对我不起作用。因为我是通过cmd命令执行adb shell的。
显然,您是从应用程序(可能是测试应用程序)而不是从终端运行
adb shell <>
命令。
adb shell <>
的应用程序)是否有清单(指定了这些权限)?两个 APK 是否使用相同的密钥签名? (这是您能够将事件从测试 apk 注入到测试中的应用程序的要求)adb shell <>
命令(您应该能够 - 如果没有在 https://b.corp.google.com/issues/new?component 下提交错误) =192795&模板=1310483)。
PS:不太可能..但如果它是系统应用程序,它应该由平台密钥签名