Mobile Local Run Setup (Windows)

If you have the proper licensing (Basically you will see the mobile commands being available in the right panel of your test cases), follow the steps below to setup local execution on your machine. 

 

System Requirements

  1. Windows 10 or Windows 11 operating system

  2. Minimum 2-core CPU

  3. Minimum 12 GB of RAM

  4. Minimum 45 GB of disk space (85 GB if all extra emulators are installed)

  5. SSD is recommended

 

Installation

  1. Install Java Development Kit (versions 17-21 - we recommend using 21 LTS). You can download from Oracle_17 or Oracle_21 or Adoptium

  2. Create an environment variable for JDK:

    1. Go to Control Panel > View By > Large Icons

    2. Click System

    3. Click Advanced System Settings

    4. Click Environment Variables button

    5. Under Variables for USERNAME, click New

    6. Enter the Variable Name as JAVA_HOME

    7. Enter the installation path of Java as a value. For example C:\Program Files\Java\jdk-17

    8. Click OK

  3. Download and install NodeJS from: Node.js — Run JavaScript Everywhere

  4. Install Appium and update drivers with NPM using Command Line Interface (CMD):

    npm install -g appium appium driver install uiautomator2 appium driver install xcuitest
    1. In order to update Appium, you can use:

    appium driver update uiautomator2 appium driver update xcuitest
  5. Click Appium Inspector to download and install Appium Desktop Inspector.

  6. Download the attached BAT file to install the all other requirements automatically or follow the next steps manually. You will need to use the file twice to install the requirements and download and install the emulators. To install, start Command Line Interface (CMD) as an admin and enter cd path_of_the_bat_file and hit Enter, then enter install_mobile.bat and hit Enter. Then follow the instructions below.

 

  • When asked “Do you want to allow the script to download and install Android SDK automatically?”, hit Y

  • When asked “Enter Path for Android SDK or Press ENTER to use Default (C:\Android-SDK)”, hit Enter

  • When asked to accept license agreements, hit Y and Enter

  • When asked “Please, provide host machine architecture type index for emulator”, pick the numbers associated with the options depending on your operating system:

    • 1 - x86

    • 2- x86_64

    • 3 - arm64_v8a

  • When asked “Do you want to install/update default emulators?” hit Y and Enter

  • When asked “Do you wish to create a custom hardware profile” hit Enter

  1. In order to check that everything was created successfully, go to C:\Android-SDK/emulator, start CMD there and execute the following command

emulator -avd Nexus_5X_Oreo -accel on
  1. The emulator should start as shown below. You can close it afterwards.

image-20240723-144916.png
  1. Open any command line interface (CMD) window and run Appium there with this command:

  1. You are now ready you execute your mobile test cases.

  2. If you want to inspect your mobile application and generate IDs or XPaths for various elements, open Appium Inspector which was installed in step 5.

  3. By default the script in step 6 will install Nexus 5x and Nexus 10 on API version 26. If you would like to install additional emulators and APIs, follow the same action in step 5 to open the script.

    1. The script will double check all previous installations and update if needed.

    2. When you see “Do you want to install/update default emulators?” hit N

    3. Enter the API version you want to install. For example 29

      image-20240723-145449.png
    4. Select the emulator device by entering the corresponding number. For example 24 for Samsung Nexus 10

    5. The script will now install the required emulator.

    6. Before execution, make sure to select the same emulator from User Preferences > Mobile > Default Mobile Platform

AVD (Android Virtual Device ) Configuration

In order to change the default values for the emulator RAM, resolution and DPI, follow the steps below:

  1. Navigate to the folder where your AVDs are located. For example: C:/Users/USERNAME/.android/avd

  2. Go to the folder with your device name, for example Google_Pixel_4XL_27_Oreo.avd and find config.ini file.

  3. The parameters below must be updated if they already exist in the file. If they do not exist, simply add the missing ones to the bottom of the file (Do not add spaces between values and equals symbol):

A full list of specification is found on the bottom of this article.

For example, if our device is Samsung Galaxy S20, we can use the following parameters:


Device Information:

Device Modifications in (config.ini.) file: