Environment variables - AWS Device Farm

Environment variables

Environment variables represent values that are used by your automated tests. You can use these environment variables in your YAML files and test code. In a custom test environment, Device Farm dynamically populates environment variables at runtime.

Common environment variables

Android tests

This section describes custom environment variables common to Android platform tests supported by Device Farm.

$DEVICEFARM_DEVICE_NAME

Name of the device on which your tests run. It represents the unique device identifer (UDID) of the device.

$DEVICEFARM_DEVICE_PLATFORM_NAME

The device platform name. It is either Android or iOS.

$DEVICEFARM_DEVICE_OS_VERSION

The device OS version.

$DEVICEFARM_APP_PATH

The path to the mobile app on the host machine where the tests are being executed. The app path is available for mobile apps only.

$DEVICEFARM_DEVICE_UDID

The unique identifier of the mobile device running the automated test.

$DEVICEFARM_LOG_DIR

The path to the log files generated during the test run. By default, all files in this directory are archived in a ZIP file and made available as an artifact after your test run.

$DEVICEFARM_SCREENSHOT_PATH

The path to the screenshots, if any, captured during the test run.

$DEVICEFARM_CHROMEDRIVER_EXECUTABLE_DIR

The location of a directory which contains the necessary Chromedriver executables for use in Appium web and hybrid tests.

$ANDROID_HOME

The path to the Android SDK installation directory.

Note

The ANDROID_HOME environment variable is only available on the Amazon Linux 2 test host for Android.

iOS tests

This section describes custom environment variables common to iOS platform tests supported by Device Farm.

$DEVICEFARM_DEVICE_NAME

Name of the device on which your tests run. It represents the unique device identifer (UDID) of the device.

$DEVICEFARM_DEVICE_PLATFORM_NAME

The device platform name. It is either Android or iOS.

$DEVICEFARM_APP_PATH

The path to the mobile app on the host machine where the tests are being executed. The app path is available for mobile apps only.

$DEVICEFARM_DEVICE_UDID

The unique identifier of the mobile device running the automated test.

$DEVICEFARM_LOG_DIR

The path to the log files generated during the test run.

$DEVICEFARM_SCREENSHOT_PATH

The path to the screenshots, if any, captured during the test run.