Connect iOS mobile devices
You can connect iOS devices to the Digital Lab server, or to a connector machine.
In this topic:
Before you start
Before connecting devices to Digital Lab, check that your devices are supported, and remove all apps that were installed using a previous version of Digital Lab.
Re-sign the Agent apps
The Agent apps are standard iOS applications that need to be installed on each device that you want to use with Digital Lab. These provide a communication channel between the device and Digital Lab.
The Agent apps must be re-signed with a development certificate of an Apple Developer Account, and a development provisioning profile belonging to the same account. These provide the identity of the developer, and the list of devices on which distribution of the app is allowed.
For details on how to re-sign these apps, see Re-sign the Agent apps.
Back to top
Initial device configuration
The first time that you connect a device, perform the following steps on each device you intend to connect to Digital Lab. These are one-time settings. After the initial connection has been set up, the device is "plug-and-play".
- In Settings > Display & Brightness > Auto-lock set the maximum time. When using a device running on iOS 11.1 or higher, make sure to insert a SIM card or a dummy SIM card in the device. Alternatively, set the Auto lock option to 30 seconds.
-
Turn off automatic updates in Settings > General > Software Update.
- For Safari browser support: Enable JavaScript and Web Inspector in Settings > Safari > Advanced.
- Make sure that the Display Zoom, under the Display and Brightness settings, is set to Standard, and not Zoomed
- If required by the apps that you are testing, make sure that there is an active Internet connection.
-
Set your preferences (such as iCloud) to avoid unnecessary pop-ups.
- Additional steps for specific iOS versions:
iOS 11.1 and earlier:
|
If you want use UI Automation, make sure that UI Automation is enabled (Settings > Developer > UI Automation). If you perform this step after connecting the device, you need to restart the device, or unplug it and plug it in again. |
iOS 15 and later:
|
We recommend not setting a passcode/ TouchID/ FaceID for iOS 15 and later unless it is necessary. If the passcode, TouchID or FaceID is not turned off on the device, when the WebdriverAgent-runner is launched, iOS requires the user to authenticate through the security mechanism configured. This requires manual intervention with the device. |
iOS 16
|
Enable developer mode in Settings > Privacy & Security > Developer Mode. For more details on developer mode, see the Apple Developer documentation. |
Back to top
Connect devices to Digital Lab
If you have not already done so, make sure that you have re-signed the Agent apps with your development certificate. For details, see Re-sign the Agent apps.
Devices can be connected via USB cable to the UFT Digital Lab server or to a connector machine. For iOS devices that support cellular networks, a SIM card should be in the device. If you are connecting devices to a connector machine, see Install the connector on a Linux machine, Install the connector on a Windows machine or Install the connector on a Mac machine.
To connect a device to the UFT Digital Lab server:
- Connect the device to the server machine using a USB cable.
Note: On some devices, when you connect the device, there may be notification, trust, or location pop-ups. Accept these pop-ups.
- Wait until the Agent is running on the device.

If the agent does not start up on the device, verify that the devices are recognized:
Linux
- Navigate to the linux folder:
Server machine:<path to you server installation folder>/server/libimobiledevice/linux/
Default: /opt/UFTMobile/server/libimobiledevice/linux/
Connector machine:<path to your connector installation folder>/connector/libimobiledevice/linux/
Default: /opt/Digital Lab/connector/libimobiledevice/linux/
- Run
idevice_id –l
The result of this command should be a list of devices IDs (UDID). If the command returns an empty result or ERROR message, try the following:
- Log in as root on the Digital Lab server or connector machine.
- Locate the process ID of “usbmuxd”"
ps aux | grep '[u]sbmuxd'
- Kill the process:
kill –9 <processID>
- Start usbmuxd again:
usbmuxd
- Run
idevice_id –l
again to see if the server recognizes the device.
Windows
- Open a command prompt window and navigate to the following folder:
Devices connected to server machine:<Path to your Windows server folder>server\libimobiledevice\win
or
Devices connected to standalone connector: <Path to your Windows Connector folder>\libimobiledevice\win
- Run the following command:
idevice_id –l
The result of this command should be a list of devices IDs (UDID). If there are no devices listed when a device is connected to USB port, this may mean that:
- The USB port is not working (hardware problem)
- iTunes is not installed, or you are not using the most up-to-date version of iTunes on the Connector computer. In this case, you should download the latest version of iTunes.
Additional considerations for iOS devices
If you have not already done so, enable UI Automation on the device in Settings >Developer> Enable UI Automation. Disconnect the device, wait 5 seconds, and then reconnect it.
Important note for Enterprise certificates
Users who install apps signed with an Enterprise certificate (that do not use a Mobile Device Management (MDM) solution) are prompted to trust the Enterprise developer the first time the app is installed. To trust the profile, go to Settings > General > Device Management, select the Enterprise developer profile, and trust it. These actions can be performed remotely on the device with Digital Lab.
All users who install your enterprise-signed app for the first time also need an internet connection. Once an Enterprise developer profile has been trusted on a device, additional apps with the same profile do not need to be trusted again, provided that the devices on which they are opened are connected to the internet. If the Enterprise developer profile of the application under test is not trusted, the Agent is not be able to open the app and a 1009 Error: "Cannot communicate with AUT" results.
Back to top
Troubleshooting iOS devices
iOS device best practices
How can I use an iOS device with no SIM card?
If you have no SIM card installed, when running XCUITEST, you may experience a crash from your device’s plug & play because of the No-SIM popup. To avoid this crash, you can use a dummy SIM card (recommended) or follow these guidelines for iOS 11.1 and higher:
- In device's system settings, configure the auto-lock of the device to 30 seconds.
- On the iOS Agent, tap two times on theDigital Lab icon.
-
Select the VNC tab.
-
Set the Avoid device lock option to 1 minute, to avoid device locking (which may occur even with the device's system auto-lock settings).
Note: To apply this setting to all connected iOS devices, configure the setting in Administration settings > iOS options. This eliminates the need to configure the setting manually on each connected device.
- It is strongly advised to also enable Application Launch Alert Dismiss . If the setting is disabled and a system alert occurs, it may block the functionality of the Avoid Device Lock feature, causing the device to lock.
Note: To apply this setting to all connected iOS devices, configure the setting in Administration settings > iOS options. This eliminates the need to configure the setting manually on each connected device.
What should I know about app certificates?
When installing an app that is already installed on the device, be sure to use the same developer certificate as the installed app. If the certificates do not match, the installation fails. For example, if the app on the device is signed with Certificate A you cannot install the same app signed with Certificate B.
The same applies if an app on the device is signed with an Enterprise certificate and you want to install the same app signed with a Developer certificate.
Workaround: If the certificates do not match, first remove the app that is already installed on the device, and then reinstall the app with the other certificate onto your device.
Note: Non-packaged hybrid apps signed with an Enterprise certificate are not supported.
How do I resolve the "Certificate was signed by an unknown authority" issue when trying to code sign an app?
When code-signing an app on a Macintosh, an Apple trusted authority certificate must be installed so that Apple can be recognized as a trusted authority by the Keychain Access app. If an Apple trusted authority certificate is not installed, any certificate issued by Apple is shown as invalid. For more details on software signing certificates, see the Apple Developer documentation.
If a certificate is shown as invalid (red) in the Keychain Access app, followed by an error “This certificate was signed by an unknown authority”, you need to download and install a new certificate from the Apple Worldwide Developer Relations Certificate Authority.
Install the certificate as follows:
1. Download the certificate from the Apple Developer support site.
2. Double-click the certificate.
3. Verify that it is valid (green) and does not display the following error: “This certificate was signed by an unknown authority”.
How can I prevent my iOS device from locking itself during replay?
If the device was set up to lock its screen, or sleep, after a certain interval, this can affect your replay.
To prevent all connected iOS device from locking, configure the Prevent auto lock setting in Administration settings > iOS options. This eliminates the need to configure the setting manually on each connected device.
Alternatively, to manually prevent a device's screen from locking up, make sure that your Display Settings for Sleep are set to "Never".
If your device continues to sleep and lock its screen, you can apply a workaround to send a pseudo-action to the device to prevent it from sleeping, and to keep the device unlocked. The pseudo-action used by this workaround, is the Volume up and Volume down controls. It does not affect the steps in your test, but you can see the control briefly at certain intervals, on the device screen.
To set up this action:
- On your device, open the Agent application.
-
On the Digital Lab icon, tap the screen two times. The advanced developer bar becomes visible at the bottom of the screen.
- Click the bottom right button, VNC, to display the VNC server details settings.
- Click in the right value column for the Avoid Device Lock feature.
- Select an interval in which to send the pseudo-action to the device, from 1 to 5 minutes.
Where do I find the log files for my iOS devices?
You can get crash logs for a device in a number of ways:
Method |
File Location |
Locate file on Linux server/connector machine |
- Change directory to the linux directory:
Devices connected to server machine: <Path to your Linux server folder>/server/libimobiledevice/linux Devices connected to standalone connector: <Path to your Linux Connector folder>/connector/libimobiledevice/linux
- Run the following command:
./idevicesyslog –u <UDID>
|
Locate file on Windows server/connector machine |
- Open a command prompt window and navigate to the following folder:
Devices connected to server machine: <Path to your Windows server folder>\server\libimobiledevice\win Devices connected to standalone connector: <Path to your Windows Connector folder>connector\libimobiledevice\win
- Run the following command:
idevicesyslog –u <UDID>
|
Locate file on Mac connector machine |
- Change directory to the linux directory:
cd /opt/UFTMobile/connector/libimobiledevice/mac
- Run the following command:
./idevicesyslog –u <UDID>
|
Sync with iTunes |
MacOS Mojave (10.14) only:
Perform a sync with iTunes to copy the files to your machine. The files are copied to:
- Windows:
C:\Users\<USERNAME>\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>
- Mac:
~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
|
Share from your device |
Locate the crash information in the following location on your device: Settings > Privacy. Scroll down and tap Analytics.
|
Open the Xcode Organizer
(requires macOS and Xcode)
|
- Launch Xcode on your desktop machine.
- Open the Xcode Organizer window. (Window menu > Organizer, or Cmd-Shift-2.)
- Find your device in the left sidebar, and then select device logs.
|
Orientation steps
When you record the packaged version of an app on iOS, the recorder generates two orientation steps after the Home navigation step.
Known issues and problem solving
Unable to click Login button or other elements of an app on remote device screen viewer
Certain elements, such as the soft keyboard, are visible on the physical device but not on the remote device display. This is due to Apple security enhancements. There may be cases where these "invisible" elements are placed on top of other elements and prevent users from interacting with them. For example, the soft keyboard may be placed over the Login button, thereby preventing users from clicking it.
When recording a packaged iOS app, the accessibilityId is not used for identification
Record and replay of packaged iOS apps uses the accessibilityLabel property and value for object recognition, and not accessibilityId. If your test logic uses the accessibilityId property and value to distinguish a specific object and you plan on testing packaged apps, set up the device as follows:
- On your device, open the Agent application.
-
On the agent logo, tap the screen two times. The advanced developer bar becomes visible at the bottom of the screen.
- Click the VNC button on the bottom right of the screen, to display the settings.
- Toggle use accessibilityId for packaged apps to on.
Unable to connect a device running on iOS 11.1 and higher to Digital Lab due to "No SIM" alert.
Insert a SIM card or dummy SIM card in the device.
Alternatively, manually configure the device and Agent app on the device as follows:
- On the device, select Settings > Display & Brightness> Auto-lock and set the timing to 30 seconds.
- Open the Agent app on the device.
- Tap the Digital Lab icon 2 times. The developer options tab bar is displayed at the bottom.
- Tap the VNC icon and set Avoid Device Lock to 1 minute.
Note: To apply this setting to all connected iOS devices, configure the setting in Administration settings > iOS options. This eliminates the need to configure the setting manually on each connected device.
iOS app crashes
If an app consistently crashes after a launch or Start Record, or if you cannot launch it with the Install application option (the actual option name may differ depending on the tool you are using) is selected, perform one of the following :
-
Run the tests with the uninstall or delete option.
Tool |
Option name |
UFT One
|
Select the Uninstall checkbox in the Record and Run Settings dialog box, in the Mobile tab. |
TruClient |
Delete App After Execution in the TruClient General Settings dialog box, in the Digital Lab settings tab. |
Sprinter |
UNINSTALL button in the APPLICATION tab of Digital Lab. |
-
Install the repackaged AUT on the device, and only use the Restart option.
Tool |
Option name |
UFT One |
Restart in the Record and Run Settings dialog box, in the Mobile tab. |
TruClient |
Restart App in the TruClient General Settings dialog box, in the Digital Lab settings tab. |
Sprinter |
RESTART button in the APPLICATION tab of Digital Lab. |
The Agent doesn't start up on the device
If the Agent does not start up on the device, verify that the devices are recognized by the server or connector machines:
Linux
- Navigate to:
Devices connected to server machine
/<path to
server installation
folder>/server/libimobiledevice/linux/
or
Devices connected to standalone connector
/<path
to connector installation folder>/connector/libimobiledevice/linux/
- Run
idevice_id –l
The result of this command should be a list of devices IDs (UDID). If the command returns an empty result or ERROR message, try the following:
- Log in as root on the Digital Lab server or connector machine.
- Locate the process ID of “usbmuxd”"
ps aux | grep '[u]sbmuxd'
- Kill the process:
kill –9 <processID>
- Start usbmuxd again:
usbmuxd
- Run
idevice_id –l
again to see if the device is recognized.
Windows
- Open a command prompt window and navigate to the following folder:
Devices connected to server machine:<Path to your Windows server folder>server\libimobiledevice\win
or
Devices connected to standalone connector: <Path to your Windows Connector folder>\libimobiledevice\win
- Run the following command:
idevice_id –l
The result of this command should be a list of devices IDs (UDID). If there are no devices listed when a device is connected to USB port, this may mean that:
- The USB port is not working (hardware problem)
- iTunes is not installed, or you are not using the most up-to-date version of iTunes on the Connector computer. Download the latest version of iTunes.
Enterprise certified apps do not launch
When trying to launch an enterprise certified app through your test (for example UFT One), the launching may fail the first time you start the app, because Apple requires the user to manually approve the app on the device. The error message asking for approval is not visible in the testing tool's interface (e.g. UFT One). However, if you launch the app manually, it is visible.
Solution: Manually launch the app and approve its certificate. Then, launch it through your test.
Could not record URL navigation steps on XCUITest devices
When recording on XCUITest devices, URL navigation was not recorded.
Workaround: If the navigation to the URL is the first step in your test, wait at least 5 seconds to make sure the JavaScript injection is complete. Click once in the address bar to open the keyboard—do not perform a double-click or press the Clear button. Type in the complete URL using the PC keyboard (not the device's) and press Enter.
Failed date picker actions
When using the date picker to select a date, make sure that you make your selection within 30 seconds. If the duration of the time selection exceeds 30 seconds, the agent times out. This issue only applies to non-packaged apps on iOS devices.
Unresponsive device
If a device doesn't work as expected, try to reset all settings. For example, if remote access doesn't work, taps don’t respond, apps don’t install, and so forth, revert to the original default settings:
Select General > Reset > Reset All Settings.
Follow the steps described in Initial device configuration.
Error in connecting during replay
For Mac Connectors connecting to iOS 11.1 devices: If your device cannot connect to Digital Lab, check the Connector log for an error when executing ./ideviceadddocument. This indicates a trust issue.
Reconnect the device, open ITunes and press Trust on the device.
Stopped Agent
If the Agent stops working on the device, do the following:
Disconnect the device by unplugging the USB cable.
Wait 5 seconds, and reconnect the device by USB cable.
If you're still having problems:
Remove the Agent apps and all applications under test (AUTs) from the device.
Close all open apps on the device.
Wait 5 seconds and reconnect the device to the USB port.
As a last resort:
Restart the device. The Agent is reinstalled.
Accept any system pop-ups on the device.
Unplug the device by disconnecting the USB cable. Wait 5 seconds and reconnect the device.
Back to top
See also: