We updated our CI machine to:
- macOS Monterey Version 12.0.1
- Xcode Version 13.1 (13A1030d)
We started to receive UITest failures with following error:
Testing failed:
MemoryLeaksUITests:
MemoryLeaksUITests-Runner (3507) encountered an error (The test runner failed to initialize for UI testing. If you believe this error represents a bug, please attach the result bundle at /Users/dev/Library/Developer/Xcode/DerivedData/MemoryLeaks-dduvihbyiuzwdnawggthtfwdgwks/Logs/Test/Test-MemoryLeaks-2021.11.05_13-43-58-+0300.xcresult. (Underlying Error: Timed out while enabling automation mode.))
The failure disappears if we enable UIAutomation for testmanagerd by providing password
However it's not one time action. This permission dialog still appears after some time during a day. We noticed it constantly appears after machine reboot.
Unfortunately it blocks us from using our CI machine as test runner.
There is no option(checkbox) to permanently enable(provide password) automation in this dialog. Also it's not possible to add it in Settings -> Security & Privacy -> Privacy - Automation.
Here is a sample project on GitHub to reproduce the issue.
Steps:
- Reboot machine
- Run in terminal
xcodebuild -target MemoryLeaksUITests -scheme MemoryLeaks test