To use Eggplant Functional for test automation of iOS devices, you need to run iOS Gateway on a Mac where the iOS devices are connected via USB. After you use iOS Gateway to connect to the device, you can use Eggplant Functional to make a VNC connection and gain automation control over the device.
You need to perform several steps to set up your devices and iOS Gateway for testing. See Setting Up iOS Testing for details about this process. Be sure you are familiar with the different iOS Gateway Testing Methods as well, which include different app signing requirements.
Before you launch your apps or create a connection to a device through the iOS Gateway, do the following:
- Launch iOS Gateway. You can do this from the Mac GUI or via the command line in Terminal by using open -n -a iOSGateway.
- Configure VNC settings in the General pane of the iOS Gateway window. For more information, see iOS Gateway Settings. These settings are configured for each device and persist on an individual computer.
Launching the App on the Device
When you connect to an iOS device through iOS Gateway, you're actually connecting to a specific app on the device. You have a few ways of launching apps in iOS Gateway:
- Launch the App Directly from iOS Gateway
- Open iOS Gateway and Launch an App Simultaneously
- Launch Apps from an Eggplant Functional Script
Use this method to launch an app on the device from directly within the iOS Gateway application.
- In the device list on the left side of the iOS Gateway window, select your connected iOS device.
- Select the app you want to launch from the list of apps on the right sidebar of the iOS Gateway window. Right-click the app and select Launch App.
- Click Start at the top of the iOS Gateway window. The icon next to the device name in the left-hand list turns green.
- You can now connect to the device over VNC, using the IP address of the Mac and the Port as displayed at the top of the iOS Gateway window. You can make this connection from Eggplant Functional, Eggplant Manager, Eggplant Automation Cloud, or Eggplant Manual.
To open iOS Gateway and launch an app on a specific device at the same time, you can use a command line call from Terminal such as the one shown below. Replace <devicename> and <appname> with the name of your device and the name of the app to be launched as they appear in the iOS Gateway.
You can also use the command line to connect to a specific device on a specific port, which can be particularly useful if you need to connect to multiple devices.
Replace <devicename>, <appname>, and <portnumber> in the code above with the actual values. If you have previously disabled AutoAssignPort, you don't need to include that argument in the launch command.
To launch an app from within your Eggplant Functional script, you can use the LaunchApp command. You can use this method to launch either the Springboard or an app that you have signed and installed on the device.