Working with iOS Mobile Devices
Overview
Eggplant Functional (EPF) supports extensive testing of iOS mobile devices. Using Eggplant's iOS Mobile Device Connections, you can test physical iOS mobile devices which are directly connected to the machine running Eggplant Functional. Additionally, you can test cloud-hosted iOS mobile devices hosted by Sauce Labs.
This section describes the testing of physical mobile devices that are connected directly to the system running Eggplant Functional. Please refer to Connecting to Sauce Labs Real Devices and Virtual Browsers for details on working with cloud-hosted iOS mobile devices. Please note that some Mobile Control and Touch Events are not supported by Sauce Labs.
Before You Start
Ensure You Have Your Developer Disks
To connect to your iOS mobile device, Eggplant Functional will need to be able to access your Developer Disks. If you are running Eggplant Functional on a Mac with Xcode installed, your Developer Disks are part of your Xcode installation. Within Xcode, you'll have a set of Developer Disks for each HW platform supported by Xcode (i.e. iPhone, iPad, etc). For each HW platform, there is a Developer Disk for each version of the OS supported on that platform. You'll need to know the path to the Developer Disks for the HW platform that you intend to test. Assuming you have installed Xcode in its default location, the path to your Developer Disks for an iPhone is /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
.
If you are planning to run Eggplant Functional on a Windows or Linux system and you want to connect to an iOS mobile device, you will need to copy the appropriate Developer Disks from a Mac system onto your Windows or Linux system. To copy your Developer Disks:
- Navigate to the appropriate Developer Disks location on a Mac system which has the latest version of Xcode installed (typically
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
). - Create a zip archive that contains the contents of this folder.
- Copy this zip archive to your Windows or Linux PC and unzip it. Take note of the location under which you unzipped the files. This is the location of your Developer Disks that you will need when connecting to your mobile device.
If you copy the files to Linux, you may need to check your file permissions, as they are sometimes set inappropriately after the copy. At a minimum, you need to ensure the "User" has RW permissions to all of the files and directories.
Obtain Copies of Your Provisioning Profile and Developer Certificates
To connect to an iOS mobile device, you must provide Eggplant Functional with a copy of your Developer Certificate and you must create a custom Provisioning Profile which allows Eggplant Functional to execute software on the mobile device to be tested. The custom Provisioning Profile must link your Developer Certificate to the specific device (or devices) to be tested and allow applications with a wildcard App ID of com.*
to execute on the device.
Once you have them, your custom Provisioning Profile and corresponding Developer Certificate must be downloaded and available as stand-alone files on the system that is running Eggplant Functional. You will need to know the locations of these files on your system and be able to specify their paths when creating the Mobile Device Connection.
This document assumes as an iOS Developer/Tester that you are already have an Apple Developer Account and are familiar with the concepts of a Provisioning Profile and Developer Certificate. If you do not already have a Developer Account, please visit the Apple Developer Program Enrollment page for information. If you are not familiar with the concepts of a Provisioning Profile or Developer Certificate, we recommend that you read Apple's online Developer Account Help documentation, paying close attention to Create Developer ID Certificates and Create a Development Provisioning Profile. If you are working on a Mac system with XCode installed, you can also manage your Developer Certificates and Provisioning Profiles via Xcode. Please refer to the XCode documentation for details.
Install iTunes or usbmuxd
(Windows or Linux Only)
If you are running Eggplant Functional on a Windows or Linux machine, you must install iTunes (Windows) or usbmuxd
(Linux) before attempting to create a Mobile Device Connection to your iOS device.
Configuring Your iOS Mobile Device for Automation
In order to have the best test automation experience on your iOS mobile device, you need to configure the device appropriately. This section describes the configuration activities that you need to perform on your iOS mobile device before you try to run test automation against it for the first time.
Enable Developer Mode
On mobile devices running iOS 16 or later, you must enable developer mode on your device before connecting to device with Eggplant Functional. Please refer to Enabling Developer Mode on a device in the Apple Xcode documentation for details on how to enable developer mode.
Establish Trust
When you first connect an iOS mobile device to your system and unlock the device, you will be prompted whether or not the device should trust the system to which you are connecting. In order to use Eggplant to automate your device, you must allow your device to trust the system on which Eggplant Functional is running (and vice versa). You should only need to do this operation the first time you connect your mobile device to the system.
Getting iOS Mobile Unique Device IDs (UDID)
If you have a single iOS mobile device that you want to test, Eggplant Functional is capable of auto-discovering the device when you connect it to Eggplant Functional and create a Mobile Device Connection. Auto-discovery only works if you have a single device connected to your system. If you have more than one iOS mobile device that you want to connect to your system simultaneously, you will need to use the UDID in order to specify to which device you want Eggplant Functional to connect. This section describes how to obtain the UDID for iOS mobile devices.
There are multiple methods to locate the UDID on your iOS phone. However you obtain the UDID, please copy the information. You can specify the UDID when you create the connection in Eggplant Functional.