In this Appium tutorial, we will learn how we can set up Appium for MAC and its dependencies on IOS platform.
Software Required
To Setup Appium on MAC below software are required:
1. Java
2. Android SDK (Android Studio)
3. Node.js
4. Appium Desktop Server
5. Eclipse or Any other IDE of your choice
6. Xcode
5. Eclipse or Any other IDE of your choice
6. Xcode
1) Install the JDK software and set JAVA_HOME
1. Install the Java Development Kit Software (JDK)
▪ Select the appropriate JDK software and click Download.
▪ The JDK software is installed on your computer, for example, at C:\Program Files\Java\jdk1.8.0_201. You can move the JDK software to another location if desired.
2. Set JAVA_HOME:
▪ Right-click My Computer and select Properties.
▪ On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, like C:\ProgramFiles\Java\jdk1.8.0_201.
2) Install Android Studio and set ANDROID_HOME
1. Install Android Studio and the SDK:
▪ Download and Install Android Studio
Set JAVA_HOME & ANDROID_HOME
1. We need to store Environment variables
in .bash_profile file so open Terminal and enter this command to
open the bash_profile:
$ vi ~/.bash_profile
2. Now to you need to go into insert mode
by pressing the `i` key from the keyboard, and write the following text
at the end of the file.
export
ANDROID_HOME=/Users/username/Library/Android/sdk
export ANDROID_SDK=$ANDROID_HOME
PATH=$PATH:$ANDROID_HOME/build-tools
PATH=$PATH:$ANDROID_HOME/platform-tools
PATH=$PATH:$ANDROID_HOME/tools
export PATH
export
JAVA_HOME="`/System/Library/Frameworks/JavaVM.framework/Versi
ons/Current/Commands/java_home`"
3. Press ESC key followed by :wq which will
save the .bash_profile file.
4. You can check that JAVA_HOME &
ANDROID_HOME are properly set by executing commands $ java -version &
$ echo $ANDROID_HOME Respectively.
3) Installation of Node.js
1. Install Node.js from: https://nodejs.org/en/download/
2. You can verify the installation by entering $ npm -version command at the
MAC Terminal and it will display the version.
4) Installation of Appium desktop server
1. Go to the Appium github project using the below link and Download the relevant Appium Desktop .exe file.
2. Install it and Open Appium.exe file and start the server
3. A Terminal should appear saying ‘The server is running’
5) Installation of Eclipse IDE
Install Eclipse ide from: https://github.com/appium/appium-desktop/releases/
6) XCode with Appium libraries setup
1. Install XCode: https://developer.apple.com/download/
2. Install Xcode Command line tools:
▪ Execute below command on Terminal:
$ xcode-select –install
3. Install Brew(If it’s not installed already):
▪ Execute below command on Terminal:
$ /usr/bin/ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/ins
tall/master/install)"
4. Install libimobiledevice:
▪ Execute below command on Terminal:
$ brew install libimobiledevice –HEAD
5. Install ios-deploy:
▪ Execute below command on Terminal:
$ npm install -g ios-deploy
6. Install carthage:
▪ Execute below command on Terminal:
$ brew install carthage
Please Note using the above setup and steps we can execute our test on the appium IOS Simulator. How to Run and configure appium test on IOS Real device will discuss in another article.
To Validate that all the setup has been done correctly we can use an node js package known as Appium doctor. Please Refer to this link to know more about it.