UIAutomator测试的安全例外

时间:2015-11-24 20:27:11

标签: android uiautomator

我的UI自动机测试在(棒棒糖)模拟器上运行绿色,但在Sony Xperia Z1(Lollipop 5.1.1)上出现此错误。有任何想法吗 ?解决办法:

11-24 20:15:00.432 29892-29892/uk.co.xxx.tm D/LifecycleMonitor: Lifecycle status change: uk.co.xxx.tm.TmActivity@17d33faf in: STOPPED
11-24 20:15:00.433 29892-29892/uk.co.xxx.tm D/LifecycleMonitor: Lifecycle status change: uk.co.xxx.tm.TmActivity@17d33faf in: DESTROYED
11-24 20:15:00.460 29892-29932/uk.co.xxx.tm I/MonitoringInstrumentation: waitForActivitiesToComplete() took: 402ms
11-24 20:15:00.479 29892-29932/uk.co.xxx.tm E/AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner Process: uk.co.xxx.tm, PID: 29892                                                                java.lang.SecurityException: Permission Denial: getIntentSender() from pid=29854, uid=2000, (need uid=1000) is not allowed to send as package android
at android.os.Parcel.readException(Parcel.java:1553)
at android.os.Parcel.readException(Parcel.java:1505)
at android.app.IUiAutomationConnection$Stub$Proxy.disconnect(IUiAutomationConnection.java:225)
at android.app.UiAutomation.disconnect(UiAutomation.java:241)
at android.app.Instrumentation.finish(Instrumentation.java:198)
at android.support.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:232)
at android.support.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:248)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:237)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)

1 个答案:

答案 0 :(得分:4)

根据java.lang.SecurityException: Permission Denial: getIntentSender() when using UiAutomation in a test,我检查了辅助功能设置,它现在运行为绿色,并且关闭了TalkBack和Switch Access。