UiPath Mobile Automation iOS Device Connection Guide

Introduction

I couldn’t connect even after following the steps in UiPath’s official documentation. Additionally, mobile testing webinars on Youtube use cloud services such as Sauce Labs and BrowserStack, so information is lacking. That’s why we’ve created a step-by-step guide on how to connect your local iOS device.

The official documentation is here.

Necessary equipment

I have summarized the equipment to be procured in advance.

  • Mac
  • Windows PC
  • USB cable (required for communication between Mac and local iOS device)
  • iOS device (either iPhone or iPad)
  • Wi-Fi environment

Connection diagram

And the connection configuration looks like this.

Environment used in this blog

There may be some differences from what is described in the blog depending on the model of Mac or iOS device and each software version, so I will write it down as a prerequisite.

  • MacBook Air with Mac M1 chip
  • Mac iOS v13.4.1
  • Xcode v14.3.1
  • App 2.0
  • iPhone7 (iOS 15.7.6) *iPhoneSE (iOS 16.5.1) has also been proven.
  • UiPath Studio v2023.4.1
  • UiPath.Mobile.Automation.Activities v2022.10.5

. Install the software on your Mac

(1) Install Xcode .

(2) Open a terminal.

(3) Run the following command to install Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

*When prompted for a password, enter your Mac login password.

export PATH="$PATH:/opt/homebrew/bin/"

(4) Run the following command to install Node.js.

brew install node

(5) Install Appium.

npm install -g appium@next
appium driver install xcuitest

2.Build WebDriverAgent with Xcode on Mac and install WebDriverAgent on local iOS device

(1) Connect your local iOS device to your Mac.

*Unlock your device when the warning pops up to allow your computer to access it.

*If the local iOS device is iOS16 or later, enable it in [Settings] > [Privacy and Security] > [Developer Mode] on the iOS device.

(2) Open a terminal.

(3) Search for WebDriverAgent.xcodeproj.

echo "$(dirname "$(find "$HOME/.appium" -name WebDriverAgent.xcodeproj)")"

*Example of output path
/Users/[XXXX]/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent

(4) Use Finder to move to the output path.

(5) Open WebDriverAgent.xcodeproj. Xcode starts.

(6) Select [WebDriverAgent] and select [WebDriverAgentRunner] in the [Targets] section. Switch to the Signing & Capabilities tab.

(7) Select [Automatically manage signing] and select a user account from [Team]. Change [Bundle Identifier] to a unique value.
Example) com.UiPathgmail.WebDriverAgentRunner

(8) Select [WebDriverAgentRunner] on the navigation bar of WebDriverAgent.

(9) Select [Product] from the XCode menu bar and click [Test] to start installing WebDriverAgent on the connected iOS device.

*If you are prompted to enter your keychain password, enter your Mac login password. It may be requested repeatedly.

*Unlock the local iOS device if Unlock is requested as shown below.

*If the following Cloud not launch “WebDriverAgentRunner” message is displayed, go to [Settings] > [General] > [VPN and device management] on your iOS device, select the untrusted developer app, and trust it.

image

(10) Check the Xcode path in the Mac terminal.

xcode-select -print-path

(11) If the path is not as shown below, execute the following.

sudo xcode-select -switch /Applications/Xcode.app

3. Get the IP address of your Wi-Fi network on Mac

(1) On your Mac, select Apple menu > System Preferences and click Network in the sidebar. Click [Details…] in the Wi-Fi connected display on the right side.

(2) Copy and save the IP address of the Wi-Fi network that your Mac is connected to for later use.

*The copied IP address will be used as the connection information setting value in UiPath Studio’s MDM. The Appium URL format is "http://[IP address]:8001 ".(8001 is the port number to start Appium.)
The IP address may change when you reconnect to Wi-Fi, so be sure to check and save it every time you start your Mac.

4.Get local iOS device UDID from Xcode

(1) Go to [Window] > [Devices and Simulators] in the Xcode menu.

(2) Select the [Devices] tab and select the connected local iOS device.

(3) Copy Identifier. This becomes the device’s UDID. Later, use it as a connection information setting value in UiPath Studio’s Mobile Device Manager.

(4) Start Appium. Run this every time you start.

export PATH="$PATH:/opt/homebrew/bin/"
appium --port 8001 --default-capabilities "{\"appium:systemPort\":9001}"

5. Configure local iOS device in UiPath Studio’s Mobile Device Manager

(1) Launch UiPath Studio, select [Mobile Test Project] from [Template] and create a project.

(2) Open Mobile Device Manager.

(3) Select the [Device] tab on the left and click the add device icon.

(4) Set the device information to connect.

  • Name - Enter a name to identify the device on the Devices tab.
  • Appium URL - Enter the Appium URL you copied in the previous step in the format http://[IP address]:8001 .
  • Platform - Click on the field and select iOS from the dropdown.
  • Device Name - Enter the name of the device.
  • Desired additional features - Add the following features.
name Value
automationName xcuitest
udid The local iOS device Identifier that you copied in the previous step

6. Execute connection with local iOS device

(1) Start the connection.

(2) Connect.

(3) Connected.

7. Launch the web application specified during connection

(1) If you want to automate with Safari, enable the web inspector in [Settings] > [Safari] > [Advanced] on your iOS device.

(2) Select the [Applications] tab on the left side of Mobile Device Manager and click the add application icon.

(3) Set application information.

(4) Start the application.

(5) Select and connect the device.

(6) The connection is established and the web page of the specified URL is displayed.

8. Connect devices and launch web applications from workflow

(1) Insert the [Connect Mobile Device] activity.

(2) Click [Select connection details] to set and save the connection details.

(3) It will be connected when you run the workflow.

9. When connecting with iOS simulator

(1) Select the iOS simulator you want to connect and switch devices.

(2) Select [Product] from the Xcode menu bar and click [Test] to start the iOS simulator on your Mac.

(3) Add the iOS simulator device in UiPath Studio’s mobile device manager and set the connection information.

(4) Execute the connection on Mobile Device Manager to connect to the Mac iOS simulator.

10. Mobile automation development

When connected to UiPath, you can build mobile automation with low code as shown below. As a demo, I wanted to quickly show it, so I used the recording function of UiPath Mobile Device Manager.

in conclusion

We have provided a guide for local iOS device connection, which is relatively difficult.

thank you

4 Likes