How to setup Appium in Ubuntu for android - android

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?

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

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

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

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

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".

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
To install node.js and appium without sudo we use linuxbrew.
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
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
Install Linux Brew using below command
ruby -e “$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
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

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.

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.

I can tell about the 14.04 version
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

Related

Boilerplate Ignite for Android using React Native on a Linux Platform

I am trying to integrate Boilerplate for Android using React Native on Ubuntu 16.04 but i don't know where to start and what to do next .
So far I did the steps below :
1)Install React-Native on Linux Platform
1. Install NodeJs and npm:
$sudo apt install curl
$curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash –
$sudo apt-get install -y nodejs
Check the version of nodejs:
$node -v
Or
$nodejs -v
Check the version of npm:
$npm -v
Install the create-react-native-app:
$sudo npm install -g create-react-native-app
Create the first project:
$create-react-native-app MyFirstProject
Move to the project directory using:
$cd MyFirstProject/
Using the next command, the development server will start:
$npm start
2)I installed Java:
$sudo add-apt-repository ppa:webupd8team/java
$sudo apt-get update
$sudo apt-get install oracle-java8-installer
$sudo apt-get install oracle-java8-set-default
3)I installed Android :
Downloaded “All Android Studio Packages” archive from:
https://developer.android.com/sdk/index.html
Extract the archive file into an appropriate location:
$sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
Lunch Android:
$./studio.sh.
The next steps would be to open the Android SDK Manager within Studio and install the API version you're targeting and any System images you'll like to run in order to get an emulator (assuming you're not using a physical device)
You'll also need to set ANDROID_HOME environment variable so React knows where the Android build tools are
For example, edit your bash profile
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
Your SDK would be under /opt, possibly
Eventually, run your code with react-native run-android

Chromwebdriver problen when installing appium

I´m installing appium using these terminal commands:
sudo npm install -g appium
npm install wd
the installation process never ends and the error is :
Error trying to install Chromedriver binary. Waiting and trying again. fn must be a function
i tried to install Chromedriver manually but i still have the same problem, i also tried to do this on a vagrant machine and i still have the same issue and i don't know how to solve this,
if anyone has an answer it will be nice to share
thank you
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
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

How to install Cordova in Linux?

I have tried to install cordova in Linux several times. When installing I got a Error "java home not set" and then node related error.
Is there any step by step guide to install cordova?
HOW TO INSTALL CORDOVA
Install Java Development Kit (JDK) Eg:
yum install java-1.7.0-openjdk-devel-1.7.0.79-2.5.5.1.59.amzn1.x86_64
Download and Install Android SDK.
download the appropriate Eclipse/Android SDK package from the Android site. Extract the downloaded files to a location where you can leave them permanently.
We now need to add this location to the PATH.
On Linux -
$ export PATH=$PATH:/opt/java/adt-linux/sdk/platform-tools:/opt/java/adt-linux/sdk/tools
$ echo $PATH
On WIndows -
setx PATH "%PATH%;C:\adt-windows\sdk\tools;C:\adt- windows\sdk\platform-tools"
::Exit command prompt and reopen for setx to take effect
path
Install Android Build Tools - API 19
Install Apache Ant
On Linux
sudo yum install ant
Ant should automatically be added to the PATH.
On Windows
Download Ant from Apache Website
Since Ant is not automatically added to the PATH, run the following:
setx PATH "%PATH%;C:\apache-ant-1.9.4\bin"
::Exit command prompt and reopen for setx to take effect
path
Install Node Package Manager
On Linux
sudo yum install npm
On Windows, download the appropriate setup file from the NodeJS site and run it.
Install Cordova
npm install –g cordova
Set up Android Virtual Device
ERRORS ENCOUNTERED
JAVA_HOME Not Set
On Linux
$ alternatives --config java
Ctrl + C or Ctrl + Break [Important. Don't Press Any Other Key.]
Copy the Location under Command
eg. Location is /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/
$ export JAVA_HOME= /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79-2.5.5.0.fc20.x86_64/
32bit Library Missing on Linux
$ sudo yum install ia32-libs
Link NodeJS and Node Folders on Linux
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
[ ensure there are no trailing “/” (slash) after the nodejs or node ]

How to install Android Studio on Ubuntu?

I have to install Android Studio on Ubuntu and I have used this link to download Android Studio.
Is there any easy way to install Studio on Ubuntu?
Below are the steps to install Android Studio in Ubuntu system:
1. Install JDK 6 or later
First, install Oracle JDK 8 (although you could also choose OpenJDK but it has some UI/performance issues) using WebUpd8 PPA.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
To make sure, it’s installed successfully, open a terminal and type (you should get the version number of the jdk you’ve installed e.g javac 1.8.0_11)
javac -version
2. Download and install Android Studio
Download the Android Studio package for Linux and extract it somewhere (e.g home directory).
Then type :
cd android-studio/bin
./studio.sh
3. Install SDK Platforms
You need to install some SDK before you jump into building android apps. Click on Configure -> SDK Manager to open Android SDK Manager. Select the latest API (to test against target build, e.g API 19 (Android 4.4.2)) and some packages in Extras (Android Support Library and Android Support Repository). Then install the selected packages.
Download the Linux SDK from the Android website.
Copy the folder to whereever you want to extract the contents.
Open a terminal there, and then run:
sudo apt-get install unzip
sudo tar xvzf android-studio-ide-135.1641136-linux.zip
cd android-studio-ide-135.1641136-linux
./studio.sh
JDK 1.7 is required for Studio 1.0 onwards:
Download the ubuntu zip from the d.android.com and repeat the steps from above
Download the jdk 1.7 by executing the following commands in terminal as mentioned webupd8:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Open Android Studio and install the SDK tools.
Caveats:
If your system has a 32 bit processor, use Platform Tools r23.0.1.
Refer to this bug for details.
Note: If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
Source: - linux-32-bit-libraries
Run the following command on terminal.
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
Don't forget to run:
/opt/android-studio/bin/studio.sh
when you are done installing.
The easiest method to install Android Studio (or any other developer tool) on Ubuntu is to use the snap package from Ubuntu Software store. No need to download Android Studio as zip, try to manually install it, add PPAs or fiddle with Java installation. The snap package bundles the latest Android Studio along with OpenJDK and all the necessary dependencies.
Step 1: Install Android Studio
Search "android studio" in Ubuntu Software, select the first entry that shows up and install it:
Or if you prefer the command line way, run this in Terminal:
sudo snap install --classic android-studio
Step 2: Install Android SDK
Open the newly installed Android Studio from dashboard:
Don't need to import anything if this is the first time you're installing it:
The Setup Wizard'll guide you through installation:
Select Standard install to get the latest SDK and Custom in-case you wanna change the SDK version or its install location. From here on, it's pretty straightforward, just click next-next and you'll have the SDK downloaded and installed.
Step 3: Setting PATHs (Optional)
This step might be useful if you want Android SDK's developer tool commands like adb, fastboot, aapt, etc available in Terminal. Might be needed by 3rd party dev platforms like React Native, Ionic, Cordova, etc and other tools too. For setting PATHs, edit your ~/.profile file:
gedit ~/.profile
and then add the following lines to it:
# Android SDK Tools PATH
export ANDROID_HOME=${HOME}/Android/Sdk
export PATH="${ANDROID_HOME}/tools:${PATH}"
export PATH="${ANDROID_HOME}/emulator:${PATH}"
export PATH="${ANDROID_HOME}/platform-tools:${PATH}"
If you changed SDK location at the end of Step 2, don't forget to change the line export ANDROID_HOME=${HOME}/Android/Sdk accordingly. Do a restart (or just logout and then log back in) for the PATHs to take effect.
Tested on Ubuntu 16.04LTS and above. Would work on 14.04LTS too if you install support for snap packages first.
Note: This question is similar to the AskUbuntu question "How to install Android Studio on Ubuntu?" and my answer equally applies. I'm reproducing my answer here to ensure a full complete answer exists rather than just a link.
Here's how I installed android studio on xubuntu.
1. Install JDK:
Go through following commands to install jdk
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
sudo apt-get install oracle-java7-set-default
If you want to install other version of jdk than replace your version number with 7 in last two commands.
2. Download the latest android studio from official site:
https://developer.android.com/studio/index.html
It is better to use latest version of android studio because I tried to install version 1.5.1 and it was not working. Then I installed version 2.1.1 and it run perfectly.
Extract downloaded android studio file in whichever folder you want.
Now go to extracted android studio-->bin directory and open terminal here. Now run following:
./studio.sh
And that's it. If you are facing any problem than comment below.
You can also Install using a PPA
link
In order to install Android Studio on Ubuntu Studio 14.04 and derivatives, do the following:
Step 1: Open a terminal using the Dash or pressing Ctrl + Alt + T keys.
Step 2: If you have not, add that repository with the following command:
sudo add-apt-repository ppa:paolorotolo/android-studio
Step 3: Update the APT with the command:
sudo apt-get update
Step 4: Now install the program with the command:
sudo apt-get install android-studio
Step 5: Once installed, run the program by typing in Dash:
studio
you can install android studio by following steps in the terminal :
sudo apt update
sudo apt install openjdk-8-jre
sudo add-apt-repository ppa:maarten-fonville/android-studio
sudo apt update
sudo apt install android-studio
make sure you have no error in installation.
Android Studio PPA is maintained by Paolo Rotolo. We just need to add PPA to our system and install it using the following commands:
$ sudo add-apt-repository ppa:paolorotolo/android-studio
$ sudo apt-get update
$ sudo apt-get install android-studio
For more, see allubuntu.com
To install android studio on ubuntu here is the simplest way possible:
First of all, you have to install Ubuntu Make before installing Android Studio. Type following commands in the same order one by one on terminal:
1) sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
2) sudo apt-get update
3) sudo apt-get install ubuntu-make
Now since you are done with Ubuntu make, use below command to install Android Studio:
4) umake android
While installation it will give you a couple of option which you can handle. So, Installation is done. You can open it and run an App of your choice. Isn’t it very easy? Let me know if you go through any problem, I can help.
Source Install Android Studio
add a repository,
sudo apt-add-repository ppa:maarten-fonville/android-studio
sudo apt-get update
Then install using the command below:
sudo apt-get install android-studio
Android Studio is now integrated in JetBrains Toolbox:
This free tool allows to easily install all JetBrains products, and Android Studio as well. Upgrade is automatic.
On Ubuntu, this tools requires FUSE (Filesystem in Userspace)
Hi If you want to install android studio on ubuntu you shoudl first have Java JDk on ubuntu.
Installing Java SDK
First you have to install Oracle on Java 7 (JDK and JRE)
Download Java SDK 32 or 64 bit depending upon your version.
java sdk on ubuntu
Then extract the file in the /tmp folder.Al dialogue box will pop up, click on replace all.An error will also pop out click close.
Go to tmp folder,a new folder name jdk and version must be created.right click on the folder and then click on rename and copy the name of the folder.
Also read How to Install Genymotion on Ubuntu
First write this command and click enter.
install android sdk on ubuntu linux
sudo su
Then write this command and press enter
if [ ! -d '/usr/lib/jvm' ]; then mkdir /usr/lib/jvm; fi
Paste this command
mv /tmp/jdk1.8* /usr/lib/jvm/
jdk1.8* = replace it with the name of the extracted folder in this example =jdk1.8.0_05
and press enter
sdk install linux
java,javac,jar,javaws = we have to replace these
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8*/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8*/bin/javac 1065
update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8*/bin/jar 1065
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8*/bin/javaws 1065
update-alternatives --config java
java -version
This was taken from
http://emulatorforpc.com/best-android-emulator-ubuntu/
I was just investigating this issue now, you should use Ubuntu Make
Which "is a command line tool which allows you to download the latest version of popular developer tools on your installation"
You could always follow the official guide on how to install Android Studio on Linux. There's even a video you can watch!
https://developer.android.com/studio/install.html
Remember to select Linux in the drop-down box.
To summarise the steps: download Android Studio and extract it and execute studio.sh to run it. If you're running 64-bit Ubuntu, you will need to run:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Follow the steps via terminal:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
after then:
sudo apt-get install oracle-java8-set-default
then;
Download Android Studio from "https://developer.android.com/studio/index.html", use All Android Studio Packages.
Unzip the file.
At last type via terminal :
cd android-studio
cd bin
./studio.sh
Then follow the commands and you're ready to go.
I was having having an issue with umake being an outdated version. What fixed it was:
sudo apt remove --purge ubuntu-make
sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt update
sudo apt install ubuntu-make
umake android

How to install and run appium in linux?

I want to do UI automation for opening an url in a real android device. For that I want to install and run appium on my linux system, please guide me how to do? Also suggest me Is there anyway to open an url in chrome browser using eclipse??
Install appium on Linux 18.04
If you have node.js installed you can try :
sudo npm install -g appium --unsafe-perm=true --allow-root
it worked for me.
I guess all the information you need to run Appium in Linux is in this here:
http://appium.io/docs/en/about-appium/getting-started/
how to run your test
http://appium.io/slate/en/master/?ruby#running-tests
and a bunch of sample code here
https://github.com/appium/sample-code
and if you want to run your test in Chrome Browser you will need Chromedriver, it's already integrated in the appium project. More info here:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
Install Appium on Linux(Fedora 22)
$ sudo dnf update -y
$ sudo dnf groupinstall -y "Development Tools"
$ sudo dnf install -y autoconf automake libtool gettext git scons cmake flex bison libcurl-devel curl ncurses-devel ruby bzip2-devel expat-devel
$ git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
Until LinuxBrew is fixed, the following is required.
Add to .bashrc:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH
## Setup linux brew
export LINUXBREWHOME=$HOME/.linuxbrew
export PATH=$LINUXBREWHOME/bin:$PATH
export MANPATH=$LINUXBREWHOME/man:$MANPATH
export PKG_CONFIG_PATH=$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH
$ ln -s $(which gcc) ~/.linuxbrew/bin/gcc-4.4
$ ln -s $(which g++) ~/.linuxbrew/bin/g++-4.4
$ brew update
$ brew install node # get node.js
$ npm install -g appium # get appium
$ npm install wd # get appium client
$ appium & # start appium
Hello appium installation is very simple , please check below steps
1)Install Latest Node.js
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
More information please check official website : https://nodejs.org/en/download/package-manager/
2) Install latest Appium
npm install -g appium
or
sudo npm install -g appium
More information please check official documentation :
https://www.npmjs.com/package/appium
install on nvm
sudo apt install build-essential checkinstall
sudo apt install libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
node -v
npm -v
npm install -g appium

Categories

Resources