Skip to main content
Version: 1.0.0

Setup Requirements for Mobile Testing

Overview​

Unlike web application testing, if the user is testing a mobile application or a Windows application, the computer, device, and agent will have specific requirements:

The testing device has an Android operating system​

  • Connect to the device via a cable.
  • The connected computer can be either Windows or macOS.
  • The device must have Developer Mode enabled.
  • The Android platform must be selected on the Agent.

alt text

The testing device has an iOS operating system​

  • Connect to the device via a cable.
  • The connected computer must be macOS.
  • The device must have Developer Mode enabled.
  • The iOS platform must be selected on the Agent.

alt text

Perform testing with the application running on the Windows operating system​

  • The device must have Developer Mode enabled.
  • You need to select the Windows platform on the Agent.

alt text

Before testing the mobile or Windows app, make sure that the computer has the following configurations installed:

Testing Android Applications or Applications Running on the Windows Operating System​

  • Android devices must have USB debugging enabled.
  • Windows, Linux, and macOS are the operating systems of the machines connected to the device.

Installation Guide​

Step 1: Download và install Android Studio: Android Studio Download

alt text

Step 2: Download và install Node.js: Node.js Download

alt text

Step 3: Tải và cài đặt JDK: JDK Download

alt text

Step 4: Cài đặt môi trường ANDROID_HOME và JAVA_HOME

  1. Enter “Environment” in the search bar of your computer, then click Edit the system environment variables.

alt text

  1. In the Advanced tab of the System Properties window, click the Environment Variables function.

alt text

  1. In the User variables for admin section, click the New button to create two variables: ANDROID_HOME and JAVA_HOME.

alt text

  1. Set the ANDROID_HOME variable:
    The value of ANDROID_HOME will be the path to the \Sdk directory after successfully installing Android Studio.

Once set, click OK.

alt text

  1. Set the JAVA_HOME variable:
    The value of JAVA_HOME will be the path to the jdk directory after successfully installing the JDK.

Once set, click OK.

alt text

Bước 5: After successfully installing Node.js, run the following cmd commands to install Appium:

  1. Open cmd by pressing the Windows + R key combination or by searching for cmd in the search bar on your computer.

  2. Run the following commands one by one in cmd:

    • npm i --location=global appium
    • appium driver install uiautomator2
    • appium driver install xcuitest
    • appium driver list

    After running the last command, if you see that uiautomator2 and xcuitest have been installed, the installation is successful.

    alt text

Testing iOS applications​

  • iOS/iPadOS devices need to have developer mode enabled.
  • The connected devices must be trusted, added to the developer profile, and properly configured in WebDriverAgent (Configuration on the device and Xcode Detailed guide).
  • The server must be MacOS.
  • Web view mode must be debuggable to inspect them.

Installation instructions​

Step 1: Install Brew
Run command on terminal:

Step 2: Install JDK
Run command on terminal:

  • brew install openjdk@17
  • brew install ideviceinstaller

Step 3: Install Node.js
Run command on terminal:

  • brew install node

Step 4: Install Appium
After installing node.js, open terminal and run the following commands one by one:

  • npm i --location=global Appium
  • appium driver install uiautomator2
  • appium driver install xcuitest

Step 5: Enviroment setting JAVA_HOME
After installing JDK, open terminal and run the following commands one by one:

  • sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
  • echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
  • export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"

Bước 6: Set up the environment ANDROID_HOME
After successfully installing ANDROID_STUDIO, open the terminal and run the following commands one by one:

  • nano ~/.zshrc
  • export ANDROID_HOME=/Users/[username_computer]/Library/Android/sdk

How to log in to a Developer account for Xcode​

Perform the following actions in Xcode:

Step 1: Click Setting.

alt text

Step 2: Click Account, add an account (the developer account).

alt text

Step 3: Click WebDriverAgent, Then click the Signing tab…> WebDriverAgentRunner, and in the 'Team' field, select the account (developer account).

alt text

How to install WebDriver for iOS devices​

Open Terminal, and run the following commands one by one:

Step 1: cd /Users/[username_computer]/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent

Step 2: mkdir -p Resources/WebDriverAgent.bundle

Step 3: xcodebuild clean build-for-testing -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination generic/platform=iOS CODE_SIGNING_ALLOWED=YES

When plugging in a new iOS device, users must install WebDriver for the device, but for the next time, just go to Xcode and run steps 1 and 3.