In this blog, we will set up Appium plugins, Appium drivers, Appium Doctor, NodeJS, UI Automator, Appium inspector, and Android Studio to create our automation scripts for Android devices. Appium 2.0 is an Android platform tool where drivers and plugins are easily created. It will allow us to cover mobile applications, desktop Apps, and Flutter Apps.

New Changes in Appium 2.0

Independent Drivers: Ability to install and work with WebDrivers based on your application platform (IOS, Android, Windows OS, Flutter).

Appium 2.0 Plugins: A few Appium plugins are available such as Images, Gestures, Wait, Reporter, and Execute-Driver.

It will no longer support the old JSONWP and MJSONWP Protocols. Only W3C WebDriver protocols are supported. By default, the Appium server runs at http://127.0.0.1:4723/.

Let’s Setup Appium 2.0

First, we need to download open-JDK Version 17 or the latest Version from OpenJDK, which is responsible for executing your Java code.

Step 1: Extract the Downloaded JDK file.
Step 2: Copy and paste the Extracted JDK file under ‘C:Program FilesJava folder’.

After installation of JDK, we need to download Maven from Maven, which is used to build and manage your project dependencies.

Step 1: Extract the Downloaded Maven file.
Step 2: Copy and paste the Extracted Maven file under ‘C:Program FilesJava folder’.

Download and Install Git from Git to track code changes in script files.
If we want to install and run the Appium server, then NodeJS will play an important role. Let’s Download and install the NodeJS MSI file Version 20.11 or the latest version from Nodejs. While installing NodeJS, check the checkbox ‘Install All necessary Tools’.

By default, Nodejs is installed under ‘C:Program Filesnodejs’
By default chocolatey is installed under ‘C:ProgramDatachocolatey’.

Install Android Studio

Once all the above steps are successfully done, download and install Android Studio IDE from Android Studio, which is used to test Android applications on various physical or emulated devices.

Note: By default, SDK is installed under the user’s directory.
Ex: ‘C:UsersASUSAppDataLocalAndroidSdk

Set Environment Variables into your system (Windows 10/11)

Environment variables are used to configure your app data to decrease the chances of unexpected errors and bugs.

Search ‘Edit the system environment variables’ in your system.
Click on ‘Environment variables’, then click ‘New’ under system variables and add the below path as per your file location.
Variable Name: ANDROID_HOME
Variable Value: C:UsersASUSAppDataLocalAndroidSdk
Variable Name: JAVA_HOME
Variable Value: C:Program FilesJavajdk-21.0.1
Variable Name: MVN_HOME
Variable Value: C:Program FilesJavaapache-maven-3.9.6

Click on ‘path’ and set the path below as per your system directory location.

How to Install Appium 2.0

Open Git bash Terminal and enter the command ‘npm i -g appium@next’ to install Appium 2.0.
npm i -g appium@next

To Check the Appium Version, enter the command ‘appium -v’ on Git bash Terminal.
appium -v
2.0.1

Start the Appium server by entering the command ‘appium’ on Git bash Terminal.
appium

[Appium] Welcome to Appium v2.0.1
[Appium] Attempting to load driver uiautomator2…
[debug] [Appium] Requiring driver at C:UsersASUS.appiumnode_modulesappium-uiautomator2-driver
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLS in your client code to connect to this server:
[Appium] http://192.168.1.3:4723/
[Appium] http://127.0.0.1:4723/ (only accessible from the same host)

Use the ‘appium driver list’ command to check appium driver lists.
appium driver list

– Listing available drivers
√ Listing available drivers
– uiautomator2@2.43.3 [not installed]
– xcuitest [not installed]
– mac2 [not installed]
– espresso [not installed]
– safari [not installed]
– gecko [not installed]
– chromium [not installed]

To Install the Appium uiautomator2 driver, enter the command ‘appium driver install uiautomator2’ on Git bash Terminal.
appium driver install uiautomator2

To Update Installed drivers, enter the command ‘appium driver list –updates’ on Git bash Terminal.
$ appium driver list –updates
– Listing available drivers
√ Listing available drivers
– uiautomator2@2.43.3 [installed (npm)] [Up to date]
– xcuitest [not installed]
– mac2 [not installed]
– espresso [not installed]
– safari [not installed]
– gecko [not installed]
– chromium [not installed]

Install Appium Doctor using the command ‘npm install -g appium-doctor’ to check Android setup-related issues.
npm install -g appium-doctor

To check the Appium Doctor version, use the command ‘appium-doctor –version’.
appium-doctor –version
1.16.2

To check android setup related issues type ‘appium-doctor –android’.
appium-doctor –android
WARN AppiumDoctor [Deprecated] Please use appium-doctor installed with “npm install @appium/doctor –location=global”
info AppiumDoctor Appium Doctor v.1.16.2
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor The Node.js binary was found at: C:Program Filesnodejsnode.EXE
info AppiumDoctor Node version is 20.11.0
info AppiumDoctor ANDROID_HOME is set to: C:UsersASUSAppDataLocalAndroidSdk
info AppiumDoctor JAVA_HOME is set to: C:Program FilesJavajdk-21.0.1
info AppiumDoctor Checking adb, android, emulator, apkanalyzer.bat
info AppiumDoctor ‘adb’ is in C:UsersASUSAppDataLocalAndroidSdkplatform-toolsadb.exe
info AppiumDoctor ‘android’ is in C:UsersASUSAppDataLocalAndroidSdktoolsandroid.bat
info AppiumDoctor ’emulator’ is in C:UsersASUSAppDataLocalAndroidSdkemulatoremulator.exe
info AppiumDoctor ‘apkanalyzer.bat’ is in C:UsersASUSAppDataLocalAndroidSdkcmdline-toolslatestbinapkanalyzer.bat
info AppiumDoctor adb, android, emulator, apkanalyzer.bat exist: C:UsersASUSAppDataLocalAndroidSdk
info AppiumDoctor ‘bin’ subfolder exists under ‘C:Program FilesJavajdk-21.0.1’

To Check Appium Plugins, Type the command ‘appium plugin list’ on Git bash Terminal.
$ appium plugin list
– Listing available plugins
√ Listing available plugins
– images [not installed]
– execute-driver [not installed]
– relaxed-caps [not installed]
– universal-xml [not installed]

To Install Appium Plugin (Ex: images) enter command ‘appium plugin install images’ on Git bash Terminal.
$ appium plugin install images
– Installing ‘images’ using NPM install spec ‘@appium/images-plugin’
√ Installing ‘images’ using NPM install spec ‘@appium/images-plugin’
i Plugin images@3.0.1 successfully installed

Download the Appium Inspector zip file from Appium Inspector. Extract the zip file and open Appium Inspector from the folder. Appium Inspector is used to find elements across different mobile platforms.

Open Android Studio that is already installed on your system.  Go to the Device Manager in the top right corner and select any Device.

 Check how many devices are connected with your system by using Command ‘adb devices’.
$ adb devices
List of devices attached
emulator-5554 device

Appium 2.0 is now successfully installed on your system!

Conclusion:

This blog should help users install and set up Appium 2.0 smoothly on their system. The main purpose of Appium 2.0 is to make the test automation process more modular and flexible. This includes transitioning to a new architecture for extensions and drivers. It will no longer support the old JSONWP and MJSONWP Protocols. Only W3C Webdriver protocols are supported. By default, the Appium server runs at http://127.0.0.1:4723/. I hope this blog post was useful in helping your transition to Appium 2.0.