Setting or changing the ANDROID_HOME path in Linux operating systems

When you want to run or play back recorded mobile tests by using the UI Test agent in HCL OneTest UI, you must ensure that the ANDROID_HOME path is set correctly in computers that run on Linux.

About this task

You must set up the ANDROID_HOME path as an environment variable, if you use the UI Test agent to playback recorded mobile tests for Android applications.

You must set up the environment variable on all computers from which you want to run mobile tests for Android applications.
Note: If you encounter errors about the Android sdk path not found when you attempt to play back mobile tests for Android applications on Windows, you might want to check if the value of the ANDROID_HOME environment variable is set correctly or change the value to point to the correct path.

Procedure

  1. Go to <install_Dir>/UITestAgent directory and stop the UI Test agent service by running the following command:

    sudo ./UITestAgent.sh stop

  2. Modify UI Test agent service (ui-test-agent.service) by performing the following steps:
    1. Open the file for editing.
    2. Search for the attribute ANDROID_HOME.
    3. Change the value of the attribute ANDROID_HOME to <user-home>/Android/Sdk.
      Note: You must point to the directory where you installed the Android SDK components. It can be the default directory as <user-home>/Android/Sdk or to the directory that contains the Android SDK.
    4. Save and close the file.
  3. Run the following command:

    sudo ./UIAgentSetup.sh

Results

You have set or changed the path to the ANDROID_HOME environment variable in the Linux operating systems.

What to do next

You can play back the recorded tests by using the UI Test agent on computers that run on Linux.