Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Appium in Ubuntu for android

Tags:

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?

like image 238
Deepak Avatar asked Mar 13 '14 09:03

Deepak


People also ask

Can Appium run on Ubuntu?

You can set up Appium on ubuntu for Android only. For iOS app testing using appium, the primary requirement is XCode which comes with only iOS Operating System which you can get only on MacBook/MacMini. However, you can set up on ubuntu for Android.

How do I know if Appium is installed on Ubuntu?

Verifying the Installation To verify that all of Appium's dependencies are met you can use appium-doctor . Install it with npm install -g appium-doctor , then run the appium-doctor command, supplying the --ios or --android flags to verify that all of the dependencies are set up correctly.


2 Answers

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 
like image 110
deepak Avatar answered Oct 15 '22 17:10

deepak


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 
like image 27
plosco Avatar answered Oct 15 '22 17:10

plosco