Hello!
The unlock prompt to start UI automation was added as an extra layer of security, to prevent potential attackers from accessing private user data on a device without their consent.
As commented above, one workaround for this workflow would be to remove the passcode on your device, which does open up its vulnerability from a security perspective, but also removes the need to enter the passcode roughly once per day.
There is no officially supported way to automate the entry of this passcode, as this would negate the benefits of this added security layer.
In summary:
- If you want the added security of this passcode requirement before a UI test can begin, you need to input the passcode manually about once per day
- If you do not need this layer of security, you can remove the passcode from your device, and allow it to be automated without any passcode entry