若不解决该问题,将没有办法做到持续测试。于是不断翻阅官方文档,找到解决方案
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.