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

Hello,

We have multiple iOS real devices attached to a Mac mini which serve as a server in a CI pipeline. From iOS 15 after a few hours, the phone requires the pin code, even if the UI automation is enabled and the pin was set at the first run.

A few mentions:

  • We need to have a pin set because the app under test needs a pin for security reasons
  • We set the display to never sleep because we cannot unlock the phone through the automation script
  • For automation, we're using Appium (https://github.com/appium/appium)

My question is, how can we handle the case without unlocking manual the phone considering that we're using the devices in a CI pipeline?

Post not yet marked as solved Up vote post of alexki07 Down vote post of alexki07
1.2k views

Replies

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.

One workaround for the workflow you describe 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 a passcode if you have one, as this would negate the benefits of the added security layer.

Note that passcode entry is not required to test simulated devices, accessed locally or via Xcode Cloud.

  • The unlock prompt to start UI automation was added as an extra layer of security,

    More security no one asked for and no one wanted. Hint: it's a test device and there is no private data to protect. Now I have to reduce the overall security of the device by removing the pin because test run over night when no one is there to type in the passcode.

Add a Comment