23

I am new in appium(automation testing technology).

I'm using a PC running Ubuntu Linux.

I have searched about this topic but I have not got any useful tutorial. Can anyone point me to the right documentation?

Kheldar
  • 5,361
  • 3
  • 34
  • 63
Deepak
  • 491
  • 1
  • 7
  • 18
  • 1
    Appium is a Unit Testing tech. The way you worded it, it sounds like it's a technology designed at testing automation. You don't seem to be trying to add Arduinos to your house and test them, so you might want to rephrase a bit. Also, by looking up Google I found a few tutorials. You might want to search Google too? – Kheldar Mar 13 '14 at 09:44

9 Answers9

25

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

sudo apt-get remove nodejs
sudo apt-get remove npm

Download latest nodejs linux binaries form http://nodejs.org/download/

Extract into a folder that doesn't need sudo rights to access, for example your home folder.

tar -xvf <downloaded_binary_tar.gz>

Add the following line to your ~/.bashrc file.

export PATH=$PATH:<full_path_of_the_extracted_node_folder>/bin

Open a now terminal and do

npm install -g appium
appium
deepak
  • 3,074
  • 2
  • 20
  • 29
17

I'm sure you will find plenty of tutorials on this (and this will only work for android since you would need an OSX box to do iOS) but here is what we did:

Install nodejs/npm:

sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

UPDATE: use homebrew to install node

Install grunt-cli:

npm install -g grunt-cli

If you run into an issue about it not being able to install in a directory, do this.

Install Appium:

npm install -g appium

Set up a symlink in your .bashrc file for Appium:

ln -s /path/to/appium.js /usr/bin/appium

Test to make sure it can run by running appium in your terminal. The output should be something like:

info: Welcome to Appium v0.16.0 (REV 292d265edd9c7aaf96f165009285c814b218363d)
info: Appium REST http interface listener started on 0.0.0.0:4723
   info  - socket.io started

Install Java JRE 6

sudo apt-get install openjdk-6-jre

Install Android SDK:

Download the SDK and extract it to your home folder.

Launch the Android SDK Manager:

~/path/to/android-sdk/tools/android

Install the packages that you'll need in the new window:

  • Android 4.X
  • Android Support Library
  • Android SUpport Repository
  • Google Play services
  • Everything under Tools
  • Everything under Extras

You can also create a symlink for the Android SDK Manager by doing:

ln -s /path/to/android-sdk/tools/android /usr/bin/android
Community
  • 1
  • 1
plosco
  • 891
  • 1
  • 10
  • 18
  • 4
    This approach won't work. Appium won't run if node/npm are install as a privileged (sudo) user. Use Homebrew for Linux to install it instead as mentioned in one of the answers. – irvanjitsingh Jan 08 '15 at 19:15
  • @plosco How to configure appium UI as it able to do on windows? How does set android `apk` at this case? Because appium is running at terminal. – catch23 Aug 15 '15 at 09:07
6

Steps to get appium working on ubuntu pc :

Install ruby: Paste the below command at terminal and hit enter

sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev

Install linux brew:Paste the below command at terminal and hit enter

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"

set path for brew

Type: gedit .bashrc at terminal and copy paste following into the .bashrc file

export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

Install node:Paste the below commands one by one at terminal and hit enter

brew update
brew install node
brew link node

Install appium

npm install -g appium


npm install wd

To start appium: Paste the below command at terminal and hit enter

appium
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
krishna chetan
  • 659
  • 1
  • 10
  • 20
  • I'm using Appium version 1.5.1 in Mac OS. I want to change appium configuration when it is installed by npm command (npm install -g appium) Is there a way to change it like changing the device name, command timeout, platform version ... Thanks. – Emna Ayadi Apr 22 '16 at 09:26
  • you can specify device name , platform etc in your script itself desired_caps['platformName'] = 'Android' desired_caps['platformVersion'] = '4.4.4' desired_caps['deviceName'] = '9e3484f6' – krishna chetan Apr 27 '16 at 17:24
  • This is really best solution for Ubuntu. – Yazon2006 Mar 27 '17 at 13:32
  • @krishnachetan, I am trying to install appium using above instructions, it went well till "brew install node", only error I got is "Error: Failed to download resource "python"", Now I am trying to run "brew link node" on terminal but I am getting error "Error: No such keg: /home/sonal/.linuxbrew/Cellar/node". Can you please help? – Sonal Dalal Aug 11 '17 at 10:44
3

Steps to install Appium on Linux.

Basics setup from the link.

Now install linuxbrew taking help from the link.

Now use the following commands from the terminal

Make sure to start a new terminal:

brew update
brew install node
brew link node
npm install -g appium@version

Hope this helps those who face the issue installing with "sudo".

Bulat
  • 720
  • 7
  • 15
user2220762
  • 565
  • 4
  • 16
3

Just to save somebodies time: on my Ubuntu 14.04 I was trying to install npm both via sudo apt-get and using binaries. Both approaches were wrong but everything is Ok after I istalled npm via HomeBrew

olyv
  • 3,699
  • 5
  • 37
  • 67
2

Many people face issue while installing appium on ubuntu because we install using sudo we should install appium using npm

Detailed step by step explanation to install appium on Ubuntu using npm

CLICK HERE

  1. To install node.js and appium without sudo we use linuxbrew.

  2. To install linuxbrew these are the dependencies

    Ruby 1.8.6 or newer
    
    GCC 4.2 or newer
    Git 1.7.12.4 or newer
    Linux 2.6.16 or newer
    64-bit x86 or 32-bit ARM platform
    
  3. Install Ruby using below command

    sudo apt-get install build-essential curl git m4 python-setuptools ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
    
  4. Install Linux Brew using below command

    ruby -e “$(curl -fsSL 
    https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
    
  5. Set Path for brew

first type sudo gedit.bashrc in terminal and copy the below in the .bashrc file.export

PATH="$HOME/.linuxbrew/bin:$PATH"exportMANPATH="$HOME/.linuxbrew/share/man:$MANPATH"export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

7 .Install Node:Open new terminal and copy the command and press enter

brew update
brew install node
brew link node

8.Finally Install Appium using below command

npm install -g appium

9.Let's Check if the installation is successfull. Open the terminal and type "appium" and hit enter.You should see something like this in the terminal

 info: Welcome to Appium v1.4.12(REV 8db2d00b9afcf2c50a09a80a2e8d56b05a902caf)
 info: Appium REST http interface listener started on 0.0.0.0:4723
 info: Console LogLevel: debug
demouser123
  • 4,108
  • 9
  • 50
  • 82
anuja jain
  • 1,367
  • 13
  • 19
1

It is very simple and easy, Please check the below steps!.

1) Install latest Node.js

Terminal commands:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs  

More information please check official website.

2) Install latest Appium

Terminal commands :

npm install -g appium

or

sudo npm install -g appium

More information please check official documentation.

Bulat
  • 720
  • 7
  • 15
Raja Rama Mohan Thavalam
  • 8,131
  • 2
  • 31
  • 30
0

I've installed the NVM on CentOS 7 and it works perfectly.

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash

I will strongly recommend going for that with which you will have control of NodeJS versions.

Btw, Linuxbrew doesn't work for me.

batman
  • 1,937
  • 2
  • 22
  • 41
0

I can tell about the 14.04 version

  1. Download the file from https://nodejs.org/en/

2.Now for extracting the file path press Ctrl+l , it will give the exact path , copy it

3.open bash.src file and it has to be open with gedit, this file is hidden Press Ctrl+h to see the hidden files

4.now in the bash.src file,paste the below commands

   export PATH=$PATH:"somepath u copied upto bin" 

   export NODE_PATH=$PATH:"somepath u copied upto bin node_modules'"

It will surely work

abishek kachroo
  • 35
  • 1
  • 11