Mobile Automation Setup Guide for iOS with Appium(C#)
Prerequisites for iOS Automation Setup on Mac
- Xcode
- Visual Studio for IDE
- Appium Sever GUI & Appium Inspector
- Android Studio for SDK
- SDK & JDK Installation and setting up environment variables
- Homebrew
- Node Dependencies
- iOS Real Device Setup
- WebDriver Agent
- Install Xcode and Xcode Command Line Tools
a. You can download Xcode from App Store/Command Line Tools from terminal
$ xcode-select — install
b. Open Xcode a Preferences -> Accounts -> Add Apple ID
2. Install Visual Studio
3. Install Appium Desktop (Server GUI + Inspector)
4. Install Android Studio + Android SDK
5. Install JDK
6. Install Homebrew
Open Terminal & Run the command:
$ /bin/bash -c “$(curl -fsSL -k https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Warning: /opt/homebrew/bin is not in your PATH. Instructions on how to configure your shell for Homebrew can be found in the ‘Next steps’ section below.
Run the command:
$ echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”’ >> /Users/username/.zprofile
7. Install npm
$ brew install npm
8. Install node
$ brew install node (if already installed: brew upgrade node)
9. Install Appium
$ npm install -g Appium
10. Install Appium Doctor
$ npm install appium-doctor -g
11. Install libimobiledevice
$ brew install libimobiledevice
$ brew install libimobiledevice –HEAD
12. Install carthage
$ brew install carthage
13. Install ios-deploy
$ brew install -g ios-deploy
14. Install ideviceinstaller
$ brew install ideviceinstaller
15. To check udid of Connected Devices
$ idevice_id -l
16. To check udid of all Devices (iOS Device + Xcode Simulators)
$ xcrun xctrace list devices
17. Install xcpretty
$ sudo gem install xcpretty
18. To set up Java & Android Home in mac
Open Terminal & Run the command:
$ nano ~/.zshenv
Set location of JDK & SDK path like:
$ source ~/.zshenv (To Apply Changes)
19. Let’s run appium doctor after all above configuration
Open Terminal & Run the command:
$ appium-doctor
20. Install WebDriverAgent
Open Terminal & Run the command:
$ cd /Applications/Appium\ Server\ GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent
21. Make directory in Resources folder
$ mkdir -p Resources/WebDriverAgent.bundle
Open the WebDriverAgent.xcodeproj project in xcode (you can find the project in one of the directories specified above)
For WebDriverAgentRunner & Integration App targets a Build Settings a Change Product Bundle Identifier value
From
“com.facebook.WebDriverAgentRunner”
to
“com.facebook.WebDriverAgentRunnerXXX”
Go to Signing & Capabilities a Select the Automatically Manage Signing check box a select your development team a Select your device
Open Terminal & Run the command:
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=udid’ test
22. After above configurations, Start Appium Server GUI
23. Start Appium Inspector and set desired capabilities
24. Start Session
Reference Links
- https://developer.apple.com/download/all/?q=Xcode
- https://visualstudio.microsoft.com/
- https://github.com/appium/appium-desktop/releases
- https://github.com/appium/appium-inspector/releases
- https://developer.android.com/studio
- https://www.oracle.com/java/technologies/downloads/
- https://brew.sh/
- https://formulae.brew.sh/formula/ideviceinstaller
- https://www.npmjs.com/package/ios-deploy
- https://libimobiledevice.org/