Wednesday, September 18, 2019

How to Install Appium on Ubuntu (Linux machine) | Appium Automation


How to Install Appium on Ubuntu (Linux machine) | Appium Automation


Let's learn how to install Appium on Ubuntu machine. Below are software we need to install in order to start mobile automation using Appium on Ubuntu:


  1. Java
  2. Node.js
  3. Android Studio
  4. Appium Desktop Server




How to Install JAVA(JDK/JRE) & set JAVA_HOME path:


$ sudo apt-get update

$ sudo apt-get install default-jre

$ sudo apt-get install default-jdk  //to install oracle jdk

$ sudo add-apt-repository ppa:webupd8team/java

$ sudo apt-get update

$ sudo apt-get install oracle-java8-installer



In order to set JAVA_HOME on linux you need to edit the .bashrc and need to specify the path of java directory.


$ vi ~/.bashrc

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

export PATH=${PATH}:${JAVA_HOME}/bin


Run below command to verify that recently saved environment variables are displaying correct path or not.

$ echo $JAVA_HOME

$ echo $PATH


How to Install Node.js without using sudo:


Do not install node.js through apt-get, which will need sudo rights and appium will not work if node.js is installed as sudo user. If you have already installed remove it using commands:

$ sudo apt-get remove nodejs

$ sudo apt-get remove npm


Download latest nodejs linux binaries from https://nodejs.org/download/release/latest/  into a folder for example  /home/username/Downloads


$ cd /usr/local tar --strip-components 1 -xzf

/home/username/Downloads/node-v8.2.1-linux-x64.tar.gz

For Verification use below commands:

$ which node //it should give you output like: usr/local/bin/node

$ node -v       //it should give you output v8.2.1 (or whichever version you have installed)


How to Install Android Studio:


Download and install Android Studio from Official Google Website: https://developer.android.com/studio/

Open terminal and Enter:

$ cd android-studio/bin

$ . studio.sh //To execute the studi.sh script

Now android studio will open. Click next and let it download required things.

Once android sdk is installed add ANDROID_HOME to environment variable using:

$ vi /.bashrc

export ANDROID_HOME=/home/user_name/Android/Sdk

export PATH=$PATH:/home/user_name/Android/Sdk/tools

export PATH=$PATH:/home/user_name/Android/Sdk/platform-tools

How to Install Appium globally:


Open terminal and enter below commands in order to install the appium globally.

$ npm install -g appium

$ appium //To start the Appium server


How to Install appium-doctor to troubleshoot the errors if any:


Please install Appium-Doctor(Node Utility) using npm, It will diagnose and fix common Node, iOS and Android configuration issues before starting Appium.

$ npm install -g appium-doctor //then

$ appium-doctor  //it will give checklist of which things are okay & which aren’t okay




No comments:

Post a Comment

If any suggestions or issue, please provide