Configuring Appium in Ubuntu from Scratch


1.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/superman/Downloads (where superman is your username and you have downloaded the file in Downloads)
  • Now install it under /usr/local using
      cd /usr/local
      tar --strip-components 1 -xzf /home/superman/Downloads/node-v8.2.1-linux-x64.tar.gz
    
  • Check the installation using
      node -v
    

2. Install java, jdk and jre

   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

3. Set the JAVA HOME path

      //open bashrc file 
      gedit ~/.bashrc
      export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
      export PATH=${PATH}:${JAVA_HOME}/bin
     //run following command to verify the path
     echo $JAVA_HOME
     echo $PATH

    Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:
   which java

4. Download android studio and set the ANDROID HOME path

  • Download android studio for ubuntu and extract it in the HOME directory
  • open terminal and enter:
      cd android-studio/bin
     ./studio.sh
    
  • Now android studio will open.Click next and let it download required things.
  • Once android sdk is installed add ANDROID_HOME to environment using:
    
     gedit ~/.bashrc
     //add following lines at the end of the file and then save
     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
    

5. Install appium globally

  npm install -g appium
  //check if appium is installed using
  appium

6.Install appium-doctor to troubleshoot the errors if any using:

   npm install -g appium-doctor
   //then 
   appium-doctor
   //it will give checklist of which things are okay and which are not

Now your system is configured with appium

If anyone come across the following error,

Error: appium-chromedriver@3.5.2 install: node install-npm.js

you need to run with few other options.

npm install -g appium --unsafe-perm=true --allow-root

This happened due for appium1.8.0 and node 10.0.

Above command will take latest version (unstable) from repo and install

Comments

Popular posts from this blog

Google play Impersonation and Intellectual Property

Creating Gauge chart in React Native

React Native Splash Screen