Skip to main content

AWS Device Farm and Deploy

AWS Device Farm is an application testing service that enables you to run your tests concurrently on multiple mobile devices to speed up the execution of your tests and generates videos and logs to help you quickly identify issues with your app.

Appcircle is integrated with the AWS Device Farm for continuous testing. You can build your app in Appcircle and deploy it directly to AWS Device Farm to run automated tests.

With the AWS Device Farm Deploy and Run step in Appcircle, you can directly deploy your binaries and test scripts during the build to the specified AWS Device Farm project and run tests.

The full details of the tests are accessible in the AWS Device Farm console.

Prerequisites

This component works separately for iOS and Android. It depends on different steps for both platforms.

caution

Pay attention to the dependent step on whichever platform you are working on.

Prerequisite Workflow StepDescription
Android Build for UI TestingThe Android Build for UI Testing workflow step is tailored to build your Android test application using Gradle Wrapper (gradlew) for the designated architectures outlined in your project.
Xcodebuild Build for TestingThis step builds your application and generates an IPA for testing so that it can be used in test automation frameworks.

For iOS

Screenshot

For Android

Screenshot

Input Variables

You can find all the parameters required for this step in the table below, with their descriptions in detail.

Screenshot
danger

Do not hard-code sensitive variables, such as tokens and API keys, directly to the parameters in the step.

We recommend using Environment Variables groups for such sensitive variables.

Variable NameDescriptionStatus
$AWS_ACCESS_KEY_IDAWS Access Key ID. Please follow the AWS documentation.Required
$AWS_SECRET_ACCESS_KEYAWS Secret Access Key. Please follow the AWS documentationRequired
$AWS_DEFAULT_REGIONAWS Default Region. The default value is us-west-2. For more information, please visit this documentation.Optional
$AWS_PROJECT_ARNThe ARN of the project for deploy and run.Required
$AWS_DEVICE_POOL_ARNThe ARN of the device pool for the run.Required
$AWS_SCHEDULE_RUN_NAME_PREFIXThe name prefix for the run to be scheduled.Required
$AWS_SCHEDULE_TEST_TYPEThe type of the test for the run. Enter BUILTIN_FUZZ for sample test runs. See API Reference.Required
$AWS_UPLOAD_TIMEOUTTime out duration (seconds) for the test file upload. The step is skipped if the time out is reached.Required
$AWS_TEST_TIMEOUTTime out duration (seconds) for the AWS Device Farm run. The step is skipped if this duration is reached, but the test execution continues in AWS Device Farm.Required
$AWS_APP_ARNThe ARN of the application package to run tests against, created with CreateUpload. If you don't set this parameter, the subsequent App Upload File Name, App Upload Type and App Upload File Path parameters are required.Optional
$AWS_APP_UPLOAD_FILE_NAMEThe file to be uploaded. The name should not contain any forward slashes (/ ). If you are uploading an iOS app, the file must have an IPA extension. If you are uploading an Android app, the file must have an APK extension.Optional
$AWS_APP_UPLOAD_TYPEThe upload type of the file. Enter ANDROID_APP or IOS_APP for simple APK or IPA uploads.Optional
$AWS_APP_UPLOAD_FILE_PATHThe file path for the app upload. You can use predetermined environment variables like $AC_APK_PATH.Optional
$AWS_TEST_ARNThe ARN of the uploaded test to be run. If you don't set this parameter, the subsequent Test Upload File Name, Test Upload Type and Test Upload File Path parameters are required.Optional
$AWS_TEST_UPLOAD_FILE_NAMEThe test file to be uploaded. The file must have a .zip extension.Optional
$AWS_TEST_UPLOAD_TYPEThe upload type of the file. Enter ANDROID_APP or IOS_APP for simple APK or IPA uploads.Optional
$AWS_TEST_UPLOAD_FILE_PATHThe file path for the app upload. You can use predetermined environment variables like $AC_APK_PATH.Optional
$AWS_TEST_SPEC_ARNThe ARN of the uploaded test spec to be run.Optional
$AWS_TEST_SPEC_UPLOAD_FILE_NAMEThe test spec file to be uploaded.Optional
$AWS_TEST_SPEC_UPLOAD_TYPEThe upload type of the test spec.Optional
$AWS_TEST_SPEC_UPLOAD_FILE_PATHThe file path for the test spec upload.Optional

How to get the ARN values

To get the ARN values, you first need to install the AWS CLI. Please refer to the guide for your operating system to install it:

Preview of Installing or updating to the latest version of the AWS CLI - AWS Command Line Interface

Once the CLI is installed, first run the following command to list the projects and get the project ARN:

aws devicefarm list-projects

You can then get the ARN of the device pools of a specific project as follows. Replace MyProjectARN with the project ARN obtained from the previous command.

aws devicefarm list-device-pools --arn MyProjectARN

For the details of the other AWS Device Farm-specific parameters, please refer to the following documents:

Preview of create-upload — AWS CLI 1.36.4 Command Reference

Preview of schedule-run — AWS CLI 1.36.4 Command Reference

After you save your settings, you can run the build and the step will be executed accordingly. You can view the details of the AWS Device Farm Deploy and Run step in the build logs:

Screenshot

The full details of the tests are accessible in the AWS Device Farm console.

Screenshot

Output Variables

Variable NameDescription
$AWS_RUN_ARNAWS Device Farm Run ARN.
$AWS_TEST_RESULTAWS Device Farm Test result.
$AWS_OUTPUT_DEVICEPOOL_ARNThe ARN of the Device pool.
$AWS_OUTPUT_APPUPLOAD_ARNThe ARN of the App Upload.

To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-aws-device-farm-deploy-and-run