To get started with Appium, we need to install some software on our machines. Let's start the installation process on different machines.
The prerequisites for the installation of Appium on Android are as follows:
In order to install the JDK, you can visit http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.
After installing the JDK, you need to set the environment variables. To do this, perform the following steps:
JAVA_HOME
.C:Program FilesJavajdk1.8.0_20jre
.%JAVA_HOME%in
. Just ensure that there is a semicolon separating this entry from the preexisting value, as shown in the following screenshot:Now, open the command prompt and enter the command java -version
to check the Java path setting. This will return the Java version available on the system.
We need to install the Android SDK to drive the test scripts on devices. You can download the Android SDK from http://developer.android.com/sdk/index.html for your operating system.
We will set the system variables for Windows using the following steps:
ANDROID_HOME
and enter the Variable value of where you have your Android SDK installed. For example, C:android-sdk
.%ANDROID_HOME%platform-tools
and %ANDROID_HOME% ools
to the Path variable under System Variables.To verify the Android path, type android
on the command prompt and press Enter. The following window will appear:
Install the packages, as shown in the preceding screenshot. If you are testing API 19, then you just need to install SDK tools (22.6), Platform-tools (19.0.1), Build-tools (19.0.3), and Android 4.4.2.
If you are setting the system variables for the first time, then you need to create the.bash_profile
file with the help of following steps:
touch ~/.bash_profile
and press enter/return.open ~/.bash_profile
. The system will open the bash_profile
file.Now, we have a bash_profile
file. In order to set the Java and Android SDK paths, we need to configure the JAVA_HOME
and ANDROID_HOME
variables in bash_profile
. Add the following paths into the file:
export JAVA_HOME=path/to/the/java/home
export ANDROID_HOME=path/to/the/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Once you have completed all the steps, type java –version
in the terminal to check the Java path setting. This will return the Java version available on the system; type android
on the terminal and install the desired Android packages.
The following are the prerequisites for installing Appium on iOS:
We need to perform the following steps to install Xcode:
To launch Xcode, you can go to the Applications
folder and then double-click on Xcode. Now you are done with the installation.
Homebrew is a software package management system for Mac, which is used to install the stuff you need that Apple didn't provide. With Homebrew, you can install many open source tools. Perform the following steps to install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".
brew doctor
. You will get the message Your system is ready to brew
; if you don't, then try to fix the warnings and errors using the brew doctor
.npm is a Node.js package manager; it is an online repository of open source Node.js projects. It is command-line utility to package installation.
The Appium server is written in Node.js; that's why we need it to download Appium. There are other ways to download the Appium server as well, which will be discussed later.
Let's install Node using brew commands. You need to run the following command to install Node:
brew install node
There are different methods to install the Appium server on Windows/iOS. Let's discuss them one by one.
You can download Appium for Windows directly from Appium's official website (http://appium.io/), or you can clone Appium from https://github.com/appium/appium.git.
Just to ensure that we are ready to start with the Appium server, enter the following command on the Command Prompt:
node Appium-doctor
You don't need to download Node; you can get it from the Appium bundle. To run the Node commands, you need to set the path for Node (for example, C:AppiumForWindows
). Before running the command, set the directory as C:AppiumForWindows
ode_modulesappiumin
.
We need to download some executable binaries to work with Appium. They are listed as follows:
44.200.94.150