This repo will hold a sample test for our ConnectApp (Android), and provide the steps to install and configure Appium on Linux (Ubuntu)
In order to run this test on Android emulator, please follow the next steps:
- Install Android Studio
- Install JAVA
- Create ENV variables and add to PATH
- Install Homebrew
- Install node + npm
- Install appium & appium-doctor
- Install appium UiAutomator2 driver
- Run appium
- Clone project & Run tests
- Snap repository
$ sudo apt update
$ sudo apt install snapd
$ sudo snap install android-studio –classic
or
- Install from Ubuntu Software Ubuntu Software
or
- Go to https://developer.android.com/studio and download it from there
$ sudo add-apt-repository -y ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt install openjdk-11-jdk
On this step, is better to add the following lines to bashrc, so we don't have to run the commands everytime we open a terminal.
$ sudo nano ~/.bashrc
add the lines at the end of the file:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
export PATH=$PATH:$JAVA_HOME/bin
export ANDROID_HOME=Android/Sdk/
export PATH=$PATH:$ANDROID_HOME/tools
As expected, the commands will depend on your instalation folders.
Update repositories in UBUNTU
$ sudo apt update
$ sudo apt-get install build-essential
if GIT is not installed:
$ sudo apt install git -y
Run Homebrew installation script
$ /bin/bash -c "$(curl -fsSL https://raw.github.com/Homebrew/install/HEAD/install.sh)"
Add Homebrew to PATH
$ (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/$USER/.bashrc
$ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
Check Brew is working fine
$ brew doctor
Your system is ready to brew.
(ONLY If a warning is present regarding GCC libs)
$ brew install gcc
$ brew install node
$ npm install appium-doctor
$ npm install -g appium
$ appium-doctor
✔ ANDROID_HOME is set to "Android/Sdk/"
✔ JAVA_HOME is set to "/usr/lib/jvm/java-11-openjdk-amd64/."
✔ ADB exists at /home/lucas/Android/Sdk/platform-tools/adb
✔ Android exists at /home/lucas/Android/Sdk/tools/android
✔ Emulator exists at /home/lucas/Android/Sdk/tools/emulator
✔ Android Checks were successful.
✔ All Checks were successful
appium driver install uiautomator2
appium server --address localhost --port 4723 --use-drivers uiautomator2 --base-path /wd/hub
$ git clone https://github.com/lucaspaisnauto/ConnectAppAppiumTest.git