Setting Up and Configuring for Mobile Site AutomationSetting Up and Configuring for Android Devices via Command Prompt

Setting Up and Configuring for Android Devices via Command Prompt

Set up and configure the Appium server and drivers for Android mobile automation using the Java Appium Framework.

Prerequisite

You must install the latest version of Java and Maven. To download Java and Maven, click here. Make sure you set the environment variables and path.

Setting Up and Configuring Appium Server and Driver

Perform the following:

Install Node.js:

Node.js is a JavaScript runtime that is required to run Appium. Download the appropriate Node.js installer from nodejs.org. Run the installer and follow the prompts to install Node.js. After installation, open a command prompt and check if Node.js is installed by running node -v to see the installed version.

Install Appium:

To install Appium using npm, run the following command:

npm install -g appium

This command will install Appium on your system, allowing you to use the

appium

command to start the Appium server. After installing Appium, you need to verify the Appium version by running the following command:

appium -v

The following image will be displayed with the appropriate version:

Command prompt showing appium -v output as version 2.5.1

Run the following command to install Appium installer:

npm install -g appium-installer

This command will download and install the necessary dependencies for running Appium, such as the Appium server and various drivers for different platforms.

Run the following command to display the Appium Installer packages:

appium-installer

The following screen will be displayed. In this screen, navigate to the Install Appium Server option.



```bash
appium-installer
```

command prompt menu with Install Appium Server option highlighted

When you select the Install Appium Server option, the following screen is displayed. Select the latest server version and press Enter. The Appium Server will be installed.

Command prompt showing appium-installer with Install Appium Server option selected
  1. Select the Install Appium Driver option to view multiple drivers.
    Appium installer terminal with Select an option Install Appium Drivers highlighted

The following screen will be displayed. Select the uiautomator2 option by pressing the Spacebar and then pressing Enter to indicate that this is selected and installed on your system.

Appium installer driver selection list with uiautomator2 checkbox selected
  1. Run Appium Doctor by selecting the Run Appium Doctor option, and then select the Android option for the platform. Appium Doctor will check your system for all the necessary dependencies required for Appium to run successfully with Android. Once Appium Doctor completes its checks, it will display a summary of the results, indicating whether your system meets the requirements for running Appium with Android.
    Appium Doctor terminal output listing necessary dependency checks for Android setup

A tick mark indicates that the necessary dependencies are installed successfully.

  1. To inspect elements using the Appium Server, download the Appium Inspector from the following link: Download Appium Inspector. Make sure to install it separately. After downloading, install and run the Appium Inspector.
  2. To run Appium on your system, launch a new Command Prompt window (exit the old one) and run the following command:
appium

The following screen displays the Appium version, path, and driver details, confirming that the installation was successful.

Command prompt showing Appium v2.5.1 startup log with REST interface listener and uiautomator2 driver