Within this post I would like to describe how to install Appium on a Windows PC.

Java Software Development Kit

java-logo

First of all, you need to install JDK (Java development kit) in your system.

  1. Visit the Java downloads page on Oracle’s website to find the JDK environment download. Scroll down until you find Java SE Latest Version and download JDK.
  2. Select the radio button to “Accept License Agreement” and choose the JDK that corresponds to your OS (Operation System -Windows, Mac, Linux, etc.)
  3. Once the downloading is complete, double click the file to begin the installation of JDK.
  4. Install the JDK
  5. After the initial installation is done, a pop up asking you where your source java files will be. You can choose to change where you want to keep your folder but it’s best to stick with what you were given first. Click Next to continue.
  6. Let the installation finish.
  7. A few brief dialog confirm the last steps of the installation process; click Close on the last dialog. This will complete Java installation process.

Java Environment variable on Windows

Environmental variables are used by the operating system to save settings (default values, locations of resources) to be used by Windows or by processes launched by users.

There are two types of environmental variables:

  • User Variables : Specific to a particular Windows user account
  • System variables : For all the user of the machine

Most of the times these variables are usually defined and initialized automatically when you install the system or other applications like JDK but there are situations in which the user must manually define them. You can also do a check on this that the system variables for Java is automatically set or not.

Testing is done by opening command prompt. Go to Start and type cmd in the Run and hit Enter. It will launch the Command Prompt. Now type ‘javac‘:

If there is no system variable to indicate where to look for this executable, the system will give an error

The solution to this problem is Set Up Java Environment Variable Path given by setting the system variables: JAVA_HOME, PATH and CLASSPATH:

After you’ve installed the Java Environment Kit (JDK) in Windows, you must set the JAVA_HOME environment variable to point to the JDK installation directory.

Setting the Variable

  1. Open the Control Panel -> System or Security –> System; the same thing can be done by right-clicking on ‘This PC’ and choosing Properties.
  2. Choose ‘Advanced system settings‘.
  3. Under the Advanced tab Choose the ‘Environment Variable…‘ option.
  4. Select New In the System variables.
  5. Define the Variable name as ‘JAVA_HOME‘ and Variable value as ‘C:\Program Files\Java\jdk1.8.0_45‘ (for this example JDK version 1.8.0 was installed in ‘C:\Program Files\Java\jdk1.8.0_45‘ folder; if needed, modify this value to reflect the real location).
  6. Now we need to specify the location in the PATH variable. For PATH, most probably it will already exists in your machine. So just select it and choose the Edit option.
  7. In the editor add the value ‘;%JAVA_HOME%\bin‘ or ‘;C:Program Files\Java\jdk1.8.0_45\bin‘.
  8. Now go to Start and type cmd in the Run and hit Enter. It will launch the Command Prompt. Type ‘java -version‘, it will display the installed version

Install Android SDK / ADB on Windows

The Android Software Developer Kit, simply named as Android SDK, or ADB is what all the advance users of Android should have installed on their Windows running computers.

Now, the Android SDK contains the platform tools and the ADB drivers and by using this step by step guide you will learn how to install the mentioned tools on your Windows based computer. But, before beginning the proper operations there should be applied some pre-requisites.

The Android SDK has some basic system requirement:

  1. Download the Android SDK Tools from here. Just go the bottom of the page where you will find the text ‘Other Download Options‘ and go for ‘SDK Tools Only‘. Choose the downloadable file corresponds to your Operating System.
  2. Tick the Terms and Conditions check box and proceed with the downloading…
  3. Extract the file if it is saved as zipped and double click the installer.
  4. To run the installer, click Run.
  5. The installation process starts. Click the Next button to continue the installation.
  6. Just leave these settings alone and click Next.
  7. Again, click on Next.
  8. After the initial installation is done, window will ask you where you want to install the Android SDK. You can choose to change where you want to keep your folder but it’s best to stick with what you were given first. Click Nextto continue.
  9. Click on Next.
  10. Let the installation finish and then click on Next.
  11. I will suggest you to tick the ‘Start SDK Manager‘ and click on Finish.
  12. If in case you have left the Check-Box ticked, it will open the SDK Manager.
  13. I recommend to install the latest five APIs which are API 21 to API 25 in our case.
  14. If you agree to install all the packages, select Accept All radio button and proceed by clicking Install button.
  15. Now let SDK manager do its work and you go, pick up a cup of coffee and wait until all the packages are installed. It may take some time depending on your internet connection.

Set Up Android Environment Variable / Path on Windows

After you’ve installed the Android SDK Environment Kit in Windows, you must set the ANDROID_HOME environment variable to point to the Android SDK installation directory.

  1. Open the Control Panel -> System or Security –> System; the same thing can be done by right-clicking on ‘This PC’ and choosing Properties.
  2. Choose ‘Advanced system settings‘.
  3. Under the Advanced tab Choose the ‘Environment Variable…‘ option.
  4. Select New In the System variables.
  5. Define the Variable name as ‘ANDROID_HOME‘ and Variable value as ‘C:\Users\UserName\AppData\Local\Android\android-sdk‘.
  6. Now we need to specify the ‘tools‘ folder location in the PATH variable of android sdk package. For PATH, most probably it will already exist in your machine. So just select it and choose the Edit option.
  7. In the editor add the value ‘;%ANDROID_HOME%\tools‘ or ‘;C:\Users\Username\AppData\Local\Android\android-sdk\tools‘.
  8. Now we need to specify the ‘platform-tools‘ folder location in the PATH variable of android sdk package. Select the Path variable and choose the Edit option.
  9. In the editor add the value ‘;%ANDROID_HOME%\platform-tools‘ or ‘;C:\Users\Username\AppData\Local\Android\android-sdk\platform-tools‘.
  10. Now go to Start and type cmd in the Run and hit Enter. It will launch the Command Prompt. Type ‘android‘.
  11. It will open the Android SDK Manager.

Install Node.Js

Automating hybrid and native mobile applications for Android and iOS is a key function handled by Appium, a node.js server. One of the core tenets of Appium is that test codes can be written in any framework or language like Ruby on Rails, C# and Java without having to modify the apps for automation purposes. The interaction between node.js server and Selenium client libraries is what ultimately works together with the mobile application.

  1. Visit the Node.JS website to download Node.JS. Scroll down little bit to find the correct installer for your OS version.
  2. Download the file
  3. Begin the installation of Node.Js
  4. During the initial installation, window will ask you where you want to install the files. You can choose to change where you want to keep your folder but it’s best to stick with what you were given first. Click Next to continue.
  5. On the next screen you will encounter some options. Just leave these alone and click Next unless you know what you are doing.
  6. Click on Next to start the main installation.
  7. Let the installation finish and now take the last steps of the installation process; click Close on the last dialog. This will complete Java installation process.

Install Appium Windows Client

  1. Visit the Appium Download page to install the Appium Desktop client. Click on Appium.exe for Windows to download the ‘.exe‘ file for Appium.
  2. Go with the latest version of Appium.
  3. Unzip the Zip file and extract the Appium folder on the same location to access the .exe file. Double click on the Appium folder.
  4. Double click the Appium Installer to start the installation process. A pop up window will display to select the appropriate language. Leave it as it is and click on OK.
  5. The installation process starts. Click the Next button to continue the installation.
  6. After the initial installation is done, window will ask you where you want to install the Appium. You can choose to change where you want to keep your folder but it’s best to stick with what you were given first. Click Next to continue.
  7. Leave this as it is and click
  8. If you wish to have a shortcut desktop icon for Appium, select the option for ‘Create a desktop icon‘ and click Next.
  9. Click on Install to initiate the final installation.
  10. Select the check box for Launch Appium and click on Finish.
  11. Appium will open up, once the installation is finished with the below message.