How to set up Appium on Linux

Appium is an open source automation framework to be used for the automation of native and hybrid mobile applications.

On Linux we install Appium using command line. There are a few steps to setting up Appium.

1- Install dependencies

In order to install dependencies for Appium, we need to run the following command

sudo apt-get install build-essential \

curl git m4 ruby texinfo libbz2-dev \

libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev

2- Install Linuxbrew

We need Node js to install Appium, so first we have to install Linuxbrew

sh -c “$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

3- Export the path variables

Just like in Windows, we have to set up path variables in Linux as well. Use the following:

vim ~/.bashrc

export PATH=”/home/linuxbrew/.linuxbrew/bin:$PATH”

export MANPATH=”/home/linuxbrew/.linuxbrew/share/man:$MANPATH”

export INFOPATH=”/home/linuxbrew/.linuxbrew/share/info:$INFOPATH”

source ~.bashrc

Press shift + z to save and exit after adding this to the bashrc file.

4- Install gcc

Use linuxbrew to install gcc

brew install gcc

5- Install Node

brew update

brew install node

brew link node

Now we can use npm to install Appium

6- Install Appium

npm install -g appium

npm install wd

7- Run Appium

Type appium on terminal and click enter.

Appium will be launched.

8- Set path variables

vim ~/.bashrc

export ANDROID_HOME=~/Android/Sdk

export PATH=$PATH:$ANDROID_HOME/tools

export PATH=$PATH:$JAVA_HOME/bin

source ~/.bashrc

Click shift +z to save.

At this point, all the necessary steps have been carried out.

Since we execute by terminal, you will not be able to find Appium in applications.

However, in your Downloads there will be a file with a name such as “Appium-linux-1.18.0–1.AppImage” having .AppImage extension.

How to run .AppImage file

1- Right-click on the AppImage and click the ‘Properties’ entry

2- Switch to the Permissions tab

3- Click the ‘Allow executing file as program’ checkbox

4- Close the dialog

5- Double-click on the AppImage file to run

Now you can launch the emulator, enter your desired capabilities in Appium, and start the session.

Software Quality Engineer