A painless guide to install Appium and Appium Inspector on Linux

Ishtiaque Foysol
2 min readJul 15, 2024

--

Prerequisites

  • A Linux operating system installed box
  • Node.js and npm (Node Package Manager)

Install npm

Follow the official instructions here.

# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 20

# verifies the right Node.js version is in the environment
node -v # should print `v20.15.1`

# verifies the right NPM version is in the environment
npm -v # should print `10.7.0`

Install Appium

Open a terminal window and run the following command to install Appium globally using npm

$ npm install --location=global appium

Run the following command to test if appium is working

$ appium --help
usage: appium [-h] [-v]
{setup,server,driver,plugin} ...

A webdriver-compatible server that facilitates
automation of web, mobile, and other types of apps
across various platforms.

positional arguments:
{setup,server,driver,plugin}
setup Select a preset of
official drivers/plugins
to install compatible with
'Linux' host platform.
Existing drivers/plugins
will remain. The default
preset is 'mobile'.
server Run an Appium server
driver Access the driver
management CLI commands
plugin Access the plugin
management CLI commands

optional arguments:
-h, --help show this help message and
exit
-v, --version show program's version
number and exit

Reference

Install UiAutomator2 Driver

Run the following command

$ appium driver install uiautomator2

Check if uiautomator is installed

$ appium driver list
✔ Listing available drivers
- uiautomator2@3.7.2 [installed (npm)]
- xcuitest [not installed]
- espresso [not installed]
- mac2 [not installed]
- windows [not installed]
- safari [not installed]
- gecko [not installed]
- chromium [not installed]

Reference

Install Appium Inspector

Appium Inspector is a graphical tool for inspecting mobile applications, interacting with UI elements, generating UI object paths and codes during automation.

Download AppImage:

Make AppImage Executable:

Open a terminal window in the downloaded AppImage file

$ chmod a+x Appium-Inspector-linux-<version>.AppImage

Run AppImage

$ ./Appium-Inspector-linux-<version>.AppImage

Reference

Download SDK Platform Tools for Linux

Download SDK Platform Tools

Untar the download and keep it in your preferable path. Set up the environment variable ANDROID_SDK_ROOT to point to the extraction directory. add the following line to .bashrc

$ export ANDROID_SDK_ROOT=/path/to/platform-tools

Run Appium and Appimage in two seperate sessions

Save Capability

Add and save the following capability to the Appium-Inspector for inspecting an Android app UI interactions like a web browser inspection


{
"platformName": "Android",
"appium:automationName": "uiautomator2"
}

Finally open an emulator, connect it with the PC with adb and start a session to interact with the app to automate.

--

--

Ishtiaque Foysol

An avid learner, a parent, a self taught hardcore tester who breaks things to fix them.