Configuration on local Mac device
In case of Hybrid Execution for iOS Apps, we need to perform some additional steps as compared to configuration required for Hybrid Execution of Web or Mobile Web Apps. They are:
1. Get an Apple Developer Account
This is required for you to download the latest version of XCode from official Apple Developer website. You can simply sign up for an Apple developer account there if you haven't already.
2. Install XCode
XCode is the Android Studio equivalent for iOS devices. It is required by the Apple build/test ecosystem.
You can get it here - XCode - Apple Developer website
3. Install HomeBrew, Node, NPM, and Carthage
Install HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Node and NPM
brew install node
Install Carthage
brew install carthage
4. Install Appium Desktop
We need to install Appium Desktop Application for the local Mac to communicate with the mobile device and run tests on it. Appium Server sets up a hub for the iOS device(s) to connect to and routes the commands from the Mac to the iOS device(s).
Appium Desktop - Official Github release page
5. Setup XCode
Open Terminal and enter the following commands to configure XCode.
sudo xcode-select --reset sudo xcode-select --switch /Applications/Xcode.app
6. Simulator Setup
Once all the above steps are done, you can use the iPhone simulator for automating your tests. You can open the simulator using the method:
Open XCode > XCode menu > Open Developer Tool > Simulator
7. Real Device Setup
In addition to the above steps, if you need to run the tests on a real device, you need to perform some more steps for automating iOS apps on real devices due to Apple's security restrictions. In that case, please follow the guide given below:
Configuration of Local iOS device(Real device only)
Also, we need to do the following on the iOS device to enable Test Execution on it.
1. Enable UI Automation by going to Settings > Developer Options(at the bottom of the page) > Enable UI Automation
Happy Automation Testing!