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
Can you elaborate a bit on your exact setup? AutomationMode should only ask for the device password if one is set. This is very unusual in situations where you don't have physical access to the device (e.g. CI).
Yes, we have the device password set. Setup is a MacMini with MacOS BigSur, Xcode 13 and two devices connected via USB. iPhone XS and iPhone 7, both iOS 15.1. It seems like the frequent asking for device code is new behaviour. I will check if we can remove the password.
We have a similar problem where we do not have physical access to the device, the device is located remotely in the cloud and the application that we are testing needs the passcode enabled on the device. This iOS 15 change of entering the passcode physically has completely blocked us with our testing. Is there any way to explicitly avoid/ give permission once? So that the OS does not ask for the passcode even if the passcode is enabled on the device? How do we make it work on CI?