Appium Installation and Configuration under Mac OS


System Requirements:-
  • macOS 10.11 or higher
  • Latest version of Xcode or Xcode command line.
  • Brew.
Introduction:
iOS 9.3 and below use Automation as its technology and iOS 9.3 onwards XCUITest is used.
In iOS 10.0 Automation was abandoned. So note Appium is configured differently with iOS9.3 and below than in iOS10.0.

So noting's here are on how Appium is installed and configured in and after iOS10.0. It is highly recommended that softwares be installed with Homebrew. Using software installed on Homebrew, the sudo command is not needed.
Listed below are the steps...


Installing Homebrew

Open the terminal, copy and run the following;

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

Use of Homebrew is to simply install a software. For example :

brew install #<package name>

If Homebrew( or brew) prompts that the Xcode version is low, you need to install the latest version of Xcode and proceed again. You can save both versions of Xcode when you are installing the latest version.

Installing Eclipse

Eclipse is an Integrated Development Environment used for writing the tests using Appium. Eclipse can be installed using the following command;

 brew cask install eclipse-jee

Installing Node.js

 brew install node@8

Check if the installation is successful.

node -v
# v6.9.1
npm -v
# 3.10.8


Appium Installation

Appium is essentially a node.js application.We can use npm to install it and after the installation is complete you can use command line to start it.

npm install -g appium

You can use appium doctor to confirm whether the environment installation is complete. 

npm install -g appium-doctor
appium-doctor

Appium graphical user interface and and also has an inspector tool to help detect the interface elements.

Here is the link.


Appium Settings

Carthage Installation

Carthage is a package manager that manages the iOS development library dependencies.

brew install carthage

Install the client language
Client language is the one that you would use to automate the tests. Language could be either Python, Java, Ruby and so on. They are also listed on the Appium page.

Installing Python

Install Python3 (Skip installing Python 2). 

brew install python3

Check successful installation.

python3 -V
# Python 3.6.0
pip3 -V
# pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)


Success with the corresponding code. MacOS comes with Python 2. So by default python calls are made with Python2 and pip.

In addition if the system version is installed before python 3, it causes the python 3 command not found after installation. In that case can try 

 brew link --overwrite python3 relink.

Install using pip

pip3 install Appium-Python-Client
# python3 -> pip3
# python -> pip

For more information visit link.

Installing Java

Install JDK 

brew tap caskroom/versions
brew cask install java8

Use Maven for dependencies

Maven is a software project management and comprehension tool. Based on the concept of the project object model (POM), maven can manage project's build, reporting and documentation from a central piece of information. Please check this link or perform a search for further details.

Add the following piece of code to pom.xml

<dependency>
  <groupId>io.appium</groupId>
  <artifactId>java-client</artifactId>
  <version>${version.you.require}</version>
  <scope>test</scope>
</dependency>

For more information visit link.


Installation Dependent Dependencies

advicesyslog and port forwarding iproxy,usbmuxd
brew install libimobiledevice --HEAD   #Communicate with iOS phonesbrew install ideviceinstaller   # Install app use
Need to use on iOS10 or higher
    npm install -g ios-deploy
Need for real devices xcpretty
    
    gem install xcpretty
Then you finish the configuration and then launch the inspector tool from Appium. If you are getting the following error;
clang: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
then the solution to that problem is to run the following command in the terminal. Check the link for further details.
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Check the following link for reference.

Installing on iOS lower than 10.0

Comments

Popular posts from this blog

Pune Diary:-S.D.Phadnis

PhotoJournal - Awake