iOS 15 - UI Test keeps asking pin code for "Enable UI Automation"

We got the newly issue that our Test devices keeps us asking for the pin code to "Enable UI Automation".

Then it works for some hours or days, but after some time it starts again.

"Enable UI Automation" is already enabled in "Settings" - "Developer" menu.

The devices are located remotely and we can't access them directly, so this is a big issue for us right now.

Is there any way to avoid this?

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.

Remote automation on IOS 15 is blocked because of this change.

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?

Is there an answer in another thread, or is this just being ignored? With remote work requirements due to the pandemic this is a big issue for us. We don't have someone there to physically check the device a couple of times a day.

To developer coment: With recent hybrid workplace changes, we've become increasingly reliant on remote access to devices. Coming from such a security-conscious company, removing a security setting from our devices entirely would be a strange solution. Elaboration on setup is not necessary to address this issue, in my opinion -- suffice to say we have mobile devices in an office to which we connect remotely. Could there even be an option to remotely enter a pin without automation enabled? OP mentioned removing the password -- would dev agree this is the way forward?

Hi, 10 months yet, Is there a solution to this issue. We have cloud solution that requires a pin code so we connect physical devices to the agent. But That pin code prevent us to run tests on devices with iOS15+ ? anyone?

MacMini requires a password to connect the device remotely, it is deathlock situation... Can someone help with this

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

Glad to hear some answer, however

Removing the passcode is no valid workaround since we have apps that require the passcode to start.

Testability is completely ignored also with Apple, at least add the option to disable the Unlock prompt under the Developer Settings. Put a disclaimer that your device is at risk when activating Developer Options.

Would be much easier if you add this extra level of security as a setting in Developers tools or Developer mode of the device, but not when the test starts!

For all Devs: I have opened a feedback assistance bug for this , if you want this to be fixed, I encourage you to open similar issues, as Apple will need how many people and organisations this affects.

https://feedbackassistant.apple.com/feedback/11793497

Raised a feedback as well, won't be visible for you but still here the reference number:

https://feedbackassistant.apple.com/feedback/11983078

Thanks for the bug reports (FB11793497, FB11983078).

I don’t have anything concrete to share on this front, other than that these reports are being seen by the right people.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

There's a workaround that you can specify passcode require time of iOS device: go to settings/Face ID&Passcode/ Require Passcode. Here you set a time to active passcode

iOS 15 - UI Test keeps asking pin code for "Enable UI Automation"
 
 
Q