WebDriverAgent Setup
Introduction
WebDriverAgent (WDA) is an essential component for automating iOS devices with Appium. It is a WebDriver server implementation for iOS that is used to remotely control iOS devices. It is developed and used at Facebook for end-to-end testing and has been open-sourced.
In our setup, WebDriverAgent acts as the bridge between the Appium server and your iOS device. Appium translates the WebDriver commands from your test script into instructions that the XCUITest framework can understand, and WebDriverAgent executes these instructions on the device.
When you installed the XCUITest driver, a compatible version of WebDriverAgent was automatically downloaded.
Prerequisites
Before proceeding, it is crucial to ensure that you have successfully completed all the previous steps in the iOS automation section. The configurations for macOS and Xcode, your Apple ID, and the physical iOS Device are all necessary for this stage.
This guide follows the manual setup process using a free Apple ID, as detailed in the Appium documentation.
1: Open WebDriverAgent
The WebDriverAgent project is located within the appium-xcuitest-driver installation directory. The easiest way to find it is by using the find command in your terminal.
find ~/.appium -name "WebDriverAgent.xcodeproj"The command will output the full path to the Xcode project. Copy this path, and open the project in Xcode.
# Example of opening the project from the terminal
open /Users/your_user/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeprojAfter opening the WebDriverAgent in XCode, the screen should look as follows:

2: Scheme and Destination
- Connect the device (iPhone) to the developer computer as described here.
- In Xcode, select the
WebDriverAgentproject in the left-hand navigator. - Click on menu
Product->Scheme->WebDriverAgentRunner. - Click on menu
Product->Destination->iPhone.
3: Signing for AgentLib
- Select the
WebDriverAgentLibtarget from the targets list. - Go to the Signing & Capabilities tab.
- Check the Automatically manage signing box.
- Select your Apple ID from the Team dropdown menu.
- Change Bundle Identifier from
com.facebook...to another different text, likecom.automatedtests...
4: Signing for AgentRunner
- Now, select the
WebDriverAgentRunnertarget. - Go to the Signing & Capabilities tab.
- Check the Automatically manage signing box.
- Select your Apple ID from the Team dropdown menu.
- Change Bundle Identifier from
com.facebook...to another different text, likecom.automatedtests...
After configuring the Signing & Capabilities tab, the screen should look as follows:

5: Build and Test
Now it's time to build WebDriverAgent and install it on your connected iOS device.
From the menu bar, select Product > Test.
This will start the build process. It may take a few minutes.
Trusting the Certificate
If this is the first time you are using your Apple ID for development on this device, the build will fail, and you will see a security error.

To resolve this, you need to trust the developer certificate on your iPhone:
Open the Settings app on your iPhone.
Go to General > VPN & Device Management.
Under Developer App, you will see your Apple ID email address. Tap on it.

Tap the Trust button.

Step 5: Verify the Installation
After trusting the certificate, go back to Xcode and run the test again (Product > Test).
This time, the build should succeed. WebDriverAgent will be installed and launched on your device, and the Xcode console will show logs from the WDA server, indicating that it is running and ready to receive commands.
The iPhone screen will shows the message "Automation Running".
Once you see the server running, you can stop the test by clicking the stop button in Xcode. The WebDriverAgent app will remain installed on your device for future automation sessions.
Limitations of a Free Apple ID
Using a free Apple ID for development and testing on your own devices is a great way to get started with iOS automation. However, it's important to be aware of the limitations that come with a free account compared to a paid Apple Developer account:
- 7-Day Provisioning Profile: The provisioning profile generated with a free Apple ID is only valid for 7 days. After this period, the
WebDriverAgentapp on your device will no longer launch, and you will need to repeat the build and test process in Xcode to reinstall it. - Limited Number of Devices: You can only register a limited number of devices for testing.
- Limited Number of Apps: You are limited to sideloading a small number of apps onto your devices.
These limitations are generally manageable for individual developers or small teams learning and developing test automation. However, for larger-scale or continuous integration environments, a paid Apple Developer account is recommended.