解决 XCUItest Enable UI Automation 每次启动需要输入锁屏密码

自从服务器更新版本后,每次执行 iOS UI 自动化测试都需要锁屏密码

解决办法

若不解决该问题,将没有办法做到持续测试。于是不断翻阅官方文档,找到解决方案

xcodebuild -target MemoryLeaksUITests -scheme MemoryLeaks test
The automationmodetool command line tool allows you to manage UI automation security preferences, see its man page for details. To resolve your issue, run the following command as a administrator on your machine: 
       automationmodetool enable-automationmode-without-authentication

To disable this mode, run the following command as a administrator on your machine: 
     automationmodetool disable-automationmode-without-authentication

Note that the man page shows leading dash in front of each of the above two commands, it is a bug. Please disregard it and use the commands as described above. 


↙↙↙阅读原文可查看相关链接,并与作者交流