Appium
Eggplant Gateway supports automating iOS physical devices and iOS simulators with Appium by connecting to an Appium server.
Eggplant Gateway use with Appium is only supported on macOS.
The Eggplant Gateway for Appium is designed to work with Appium 2.0 (W3C WebDriver protocol).
Prerequisites
Before using Eggplant Gateway with Appium, you must do the following:
- Install the latest supported Xcode version on your Mac.
- Install Node.js and npm.
- Install Appium server.
- Install the iOS driver:
appium driver install xcuitest
. - Configure a developer certificate and Provisioning Profile, which allow you to sign iOS applications and run iOS applications on your devices. The Appium gateway supports the basic (automatic) configuration using xcodeOrgId and xcodeSigningId.
Getting Started
Enabling Automation on Your iOS Physical Device
- Establish trust between your PC and your device as follows:
- Connect your iOS device to your PC using a USB cable. The pop-up Trust this Device will appear on your iOS device.
- Click Trust. It can take up to one minute for your iOS device and your machine to initiate the pairing process.
- Enable developer mode on your device (iOS 16 and later):
- In the Settings app on your iOS device, scroll down and tap Developer Mode.
- Turn on the Developer Mode toggle at the top. A prompt will appear at the bottom asking you to reboot your iOS device to enable the feature. Tap Restart to proceed.
- Your iOS device will restart, and should prompt you to enable Developer Mode. Tap Turn On to enable Developer Mode. Then you should be able to connect.
- (Optional) In order to test iOS 17 devices, download the Apple iOS 17 platform:
- From the XCode menu choose Settings.
- Open the Platform pane in Settings.
- Locate the iOS 17 item and press Get next to it. If iOS is not available in the list, you may need to upgrade XCode to make it available.
Running Automation on an iOS Simulator
Eggplant Gateway with an Appium connection can automatically start the iOS simulator. You can also manually pre-start an iOS simulator from Xcode as follows:
- Launch Xcode, then choose Xcode > Open Developer Tool > Simulator or Control-click the Xcode icon in the Dock, and from the shortcut menu, choose Open Developer Tool > Simulator.
- Click File > Open Simulator. A list of available simulators will be displayed. You can then choose one.
Creating a Connection
To create an Eggplant Gateway for Appium connection to a physical iOS device, run the following command:
epgw add appium
--name <name> (REQUIRED)
--deviceId <udid> (REQUIRED)
--platformName "iOS"
--xcodeSigningId <signingId> (REQUIRED)
--xcodeOrgId <teamId> (REQUIRED)
For example,
epgw add appium --name appium-ios17 --platformName "iOS" --deviceId "" --xcodeOrgId "Q73Y67F7ET" --xcodeSigningId "iPhone Developer"
The available options are:
Key | Description |
---|---|
name | The connection name. |
platformName | The platform name (currently only iOS is supported). |
deviceId | The UDID of the physical iOS device or the UDID of the iOS simulator 1 you want to automate. |
xcodeSigningId | The signing id, usually Apple Developer or iPhone Developer. It can be left blank for simulator. |
xcodeOrgId | The team identifier. It can be left blank for simulator. |
help | Show help and usage information. |
Connecting to Eggplant Functional
Follow these steps to start an emulator through Eggplant Functional:
- Start Appium server:
appium
. - Run
epgw vnc <name>
, where name is the name of your Gateway connection.
For example,epgw vnc appium-ios17
.- The Eggplant Gateway will start:
- A VNC server at port 5900
- A WebDriver server at port 5000
- The Eggplant Gateway will start:
- Start Eggplant Functional and manually add your device to the connection list.
Footnotes
-
The UDID of the iOS simulator can be retrieved using
xcrun simctl list
in the terminal. ↩