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_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.

$DEVICEFARM_CHROMEDRIVER_EXECUTABLE

The version of the Chrome browser.

$DEVICEFARM_TEST_PACKAGE_NAME

The name of the package (e.g. com.example.myapp) under test.

Note

This is only available when using android native instrumentation tests. For more information, see Working with Instrumentation for Android and AWS Device Farm.

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.