Install Appium and Dependencies for Mobile Automation

1. Setting Up the Appium Environment

To get started with Appium, you need to have the following software installed on your system:

  • Java Development Kit (JDK)
  • Android Studio (for Android testing)
  • Xcode (for iOS testing)
  • Node.js
  • Appium Desktop or Appium Server

You can download and install all these tools from their respective websites. Once you have installed these tools, you can follow the steps below to set up your Appium environment.


Step 1: Install Node.js

Node.js is a JavaScript runtime that allows you to run JavaScript code outside the browser. Appium is built using Node.js, so you need to install it on your system before you can start using Appium.

You can download Node.js from the official website: https://nodejs.org/en/download/. Once you have downloaded the installer, run it and follow the prompts to complete the installation.


Step 2: Install Appium

Appium can be installed in two ways: Appium Desktop and Appium Server. Appium Desktop is a graphical user interface (GUI) application that provides a simple way to start and stop the Appium server, inspect the application, and set up the desired capabilities.

To download Appium Desktop, go to the official website: https://github.com/appium/appium-desktop/releases/latest and download the appropriate version for your operating system.

Once you have downloaded the installer, run it and follow the prompts to complete the installation.

Alternatively, you can install Appium Server using npm (Node Package Manager). To do this, open a command prompt or terminal window and run the following command:

npm install -g appium

This command will download and install Appium Server globally on your system.


Step 3: Set up Android and iOS Environments

To automate mobile app testing using Appium, you need to set up the Android and iOS environments.

You need to install Android Studio for Android testing, which provides the Android SDK and tools required for testing. You can download Android Studio from the official website: https://developer.android.com/studio.

Once you have downloaded the installer, run it and follow the prompts to complete the installation. During the installation process, select the components that include the Android SDK and tools.

After installing Android Studio, you must configure the Android SDK path in the environment variables. To do this, follow the steps below:

  1. Open the System Properties window (Press Win + Pause)
  2. Click on "Advanced system settings"
  3. Click on "Environment Variables"
  4. Under "System Variables", scroll down and click on "New"
  5. Enter "ANDROID_HOME" as the variable name and the path to your Android SDK folder as the variable value (e.g., C:\Users\username\AppData\Local\Android\Sdk)
  6. Click "OK


2. Setup and Install Appium for MAC

Let's take a look at the installation steps for Appium on MAC:


2.1. List of Downloads:

1. Download Appium version 1.XX (.dmg) file from https://bitbucket.org/appium/appium.app/downloads/

2. Download Appium-master from https://github.com/appium/appium/

3. Download the latest Android SDK.

4. Install the latest Xcode.

5. Update Android SDK with

    a) Latest API level

    b) Android SDK Build tools, SDK tools, and SDK platform-tools from tools

    c) Google USB driver and Google Web driver from extras.

6. Download safari-launcher from https://github.com/budhash/SafariLauncher for mobile web testing on iPhone.


2.2. Update Environment Variables :

1. Open terminal

2. vi .bash_profile 

3. press 'i' and  enter these export commands

a) export ANDROID_HOME=android sdk path

b) export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH

c) press the Esc key.

4. ‘Shift’ + ’:’

5. wq > enter

6. Re-open the terminal.


2.3. Installing IOS_Web_PROXY:

1. open the terminal and enter these commands 

> ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

> brew update

> brew install ios-webkit-debug-proxy


2.4. Installing safari-launcher on iPhone

1. You would require an Apple account linked with the developer program.

2. Add the device to the developer program.

3. Launch the Safari-launcher.app on a connected device from Xcode.

2.5. Pre-Script Steps in terminal ios_webkit_debug_proxy

  • cd ./bin/ios-webkit-debug-proxy-launcher.js -c:27753
  • Configuring Appium from its source code
  • Run this bin/appium-doctor.js from the installed appium folder.
  • Copy .git folder from cloned appium (git clone https://github.com/appium/appium.git)
  •  Navigate to the appium folder and execute ./reset.sh
  • Provide the path of the installed appium source code in “Use External Appium Package” in Appium UI under the Developer setting.

   

Troubleshooting:

1. If an error related to ideviceintaller occurs, then:

  • Execute brew install --HEAD ideviceinstaller 

2. If an error related to the provisional profile occurs, then execute the following command after navigating to the installed Appium folder:

  • Execute ./reset.sh --ios --ios-safari 



Author
Vaneesh Behl
Passionately writing and working in Tech Space for more than a decade.

Comments

Popular posts from this blog

Automation Practice: Automate Amazon like E-Commerce Website with Selenium

17 Best Demo Websites for Automation Testing Practice

14 Best Selenium Practice Exercises for Automation Practice

Python Behave Tutorial: A Comprehensive Guide to Behavior-Driven Development (BDD)

Mastering Selenium Practice: Automating Web Tables with Demo Examples

Selenium IDE Tutorial: How to Automate Web Testing with Easy-to-Use Interface

How to Automate Google Search with Selenium WebDriver

Top 10 Highly Paid Indian CEOs in the USA

Top 7 Web Development Trends in the Market

Find Broken Links on Webpage with Selenium Automation