Pyhton3+AirTest+[005]+小程序UI自动化之报错:uid 2000 does not have android.permission.WRITE_SECURE_SETTINGS解决方法

UI报错:

stdout[b''] stderr[b'Security exception: uid 2000 does not have android.permission.WRITE_SECURE_SETTINGS.\r\n\r\njava.lang.SecurityException: uid 2000 does not have android.permission.WRITE_SECURE_SETTINGS.\r\n\tat android.app.ContextImpl.enforce(ContextImpl.java:1953)\r\n\tat android.app.ContextImpl.enforceCallingPermission(ContextImpl.java:1971)\r\n\tat com.android.server.inputmethod.InputMethodManagerService$ShellCommandImpl.lambda$onCommand$0$InputMethodManagerService$ShellCommandImpl(InputMethodManagerService.java:4867)\r\n\tat com.android.server.inputmethod.-$$Lambda$InputMethodManagerService$ShellCommandImpl$DbZq_GIUJWcuMsIpw_Jz5jVT2-Y.accept(Unknown Source:4)\r\n\tat java.util.Arrays$ArrayList.forEach(Arrays.java:3805)\r\n\tat com.android.server.inputmethod.InputMethodManagerService$ShellCommandImpl.onCommand(InputMethodManagerService.java:4867)\r\n\tat android.os.ShellCommand.exec(ShellCommand.java:104)\r\n\tat com.android.server.inputmethod.InputMethodManagerService.onShellCommand(InputMethodManagerService.java:4841)\r\n\tat android.os.Binder.shellCommand(Binder.java:881)\r\n\tat android.os.Binder.onTransact(Binder.java:765)\r\n\tat com.android.internal.view.IInputMethodManager$Stub.onTransact(IInputMethodManager.java:433)\r\n\tat com.android.server.inputmethod.InputMethodManagerService.onTransact(InputMethodManagerService.java:1628)\r\n\tat com.android.server.inputmethod.ColorInputMethodManagerService.onTransact(ColorInputMethodManagerService.java:82)\r\n\tat android.os.Binder.execTransactInternal(Binder.java:1021)\r\n\tat android.os.Binder.execTransact(Binder.java:994)\r\n']

解决方法:

小米:在开发者选项里,把“USB调试(安全设置)"打开即可。 允许USB调试修改权限或模拟点击

oppo:在开发者选项里,把"禁止权限监控"打开即可。