iOS Real Device Appium Setup

SDET
2 min readJan 4, 2022

Step 1: Install Java JDK

Set environment variables

JAVA_HOME

PATH

java -version

Step 2: Install Homebrew

https://brew.sh/

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 3: Install node js and npm

brew install node

Step 4: Install Appium : npm install -g appium

Install Appium Desktop (optional)

Step 5: Get XCode

Xcode is the development and debug environment on Mac.

Provides required tools, files for dev/automation for Mac and iOS apps

Step 6: Install XCode command line tools

Open terminal and run

xcode-select — install

Step 7: Create Apple ID

Goto Xcode — preferences — account

Add Apple ID

Step 8: Install Carthage brew install Carthage

In order to launch WebDriverAgent, your macOS will need to have Carthage installed

(Not needed for automation on android)

Step 9: Initialize WebDriverAgent project

On terminal cd to WebDriverAgent folder

WebDriverAgent driver will be found in /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

For Appium Desktop

/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

mkdir -p Resources/WebDriverAgent.bundle

Step 10: Open WebDriverAgent.xcodeproj in Xcode

Project name : WebDriverAgent.xcodeproj

Location :

For Appium Desktop

/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

Step 11: Under the project in Xcode

For WebDriverAgentLib and WebDriverAgentRunner targets, go to general tab and select “Automatically manage signing”, and then select your Development Team

Xcode may fail to create a provisioning profile for the WebDriverAgentRunner target:

Failed to create a provisioning profile

No profile for ‘…..’ were found

manually change the bundle id for the target by going into the “Build Settings” tab, and changing the “Product Bundle Identifier” from com.Facebook.WebDriverAgentRunner to something that Xcode will accept:

Going back to the “General” tab for the WebDriverAgentRunner target, you should now see that it has created a provisioning profile and all is well:

Clean — Build — Run

Finally, you can verify that everything works. Build the project:

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=udid’ test

udid = device UDID

To get the udid of the real device connected

ios-deploy -c OR instruments -s devices

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=00008101–000130113E82001E’ test

--

--