Oct 29, 2017

Setup to Run Safari on iOS real device with XCUITest

  • To able to run your tests against Safari browser on a real device you will need to install the ios-webkit-debug-proxy in your mac.
  • Turn on web inspector on iOS device (settings > safari > advanced)

Pre-Requisited installations :


1. Run below command in the terminal if you don't have brew installed on your mac.

  • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. Once brew is successfully installed, run the below commands one by one.
  • npm install -g appium - To install appium
  • brew update
  • brew install ios-webkit-debug-proxy
  • brew install carthage
  • brew install libimobiledevice --HEAD
  • npm install -g ios-deploy
3. Once the above commands are successfully installed, go and check the WebdriverAgent path in where the Appium is installed.

Path : <installed location>/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent. 

4. Once find open a terminal and go to that location, then run the following in order to set the project up:

  • mkdir -p Resources/WebDriverAgent.bundle 
  • sh ./Scripts/bootstrap.sh -d

5. Open the WebDriverAgent.xcodeproj from WebDriverAgent folder in Xcode .
























6. Select "Automatically manage signing" in the "General" tab for both the WebDriverAgentLib and WebDriverAgentRunner targets, then select your Development Team. This should also auto select the Signing Certificate.























7. If Xcode fail to create a provisioning profile for the WebDriverAgentRunner target, you need to change the bundle id for the target by going into the "Build Settings" tab.Change the "Product Bundle Identifier" from com.facebook.WebDriverAgentRunner to some other name that Xcode will accept. Then come to "General" tab and see the signing certificate.









































8. Finally build the Xcode project with the connected device UDID
  • xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>'

No comments:

Post a Comment

Mobile App Automation with Appium on Android Emulator/Device

Overview :- Appium  is an open source test automation tool for mobile applications. It allows you to test all the three types of mobile...