DEV Community

Sophie @Appcircle for Appcircle.io

Posted on

HOW TO DEPLOY IOS AND ANDROID APPS TO AWS DEVICE FARM AND RUN TESTS AUTOMATICALLY

Reading Time: 5 minutes

Appcircle is a mobile CI/CD platform that provides a fully automated environment to manage mobile app CI, CD and CT (continuous testing).

For continuous testing, you have a number of options with Appcircle and you can use AWS Device Farm for multiple-device testing. In this article, we will be integrating AWS Device Farm to your mobile CI/CD workflow in a few easy steps so that you can deploy apps and run tests automatically for a complete CI-CD-CT.

Manage your mobile CI, CD and CT (continuous testing) with Appcircle

Start for Free

Adding AWS Device Farm Step to the Build Workflow

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

To start, you need to add the

  • "Android Build for UI Testing" step for Android
  • "Xcodebuild Build for Testing" step for iOS

followed by the "AWS Device Farm Deploy and Run" step to the workflow from the workflow marketplace.

If you just want to run tests, you can also remove other build steps such as "Android Build" or "Xcodebuild for Devices".

Android workflow for AWS Device Farm

iOS workflow for AWS Device Farm

Configuring the AWS Device Farm Step in the Workflow

Once these steps are added, press save to exit the workflow edit mode and click on the AWS Device Farm step.

The input values are as follows:

It is highly recommended to add the keys as secret environment variables instead of typing them here for security purposes.

  • AWS Project ARN: The ARN of the project for deploy and run.
  • AWS Device Pool Arn: The ARN of the device pool for the run.
  • AWS Device Farm Run Name Prefix: The name prefix for the run to be scheduled. AWS Device Farm Run Test Type: The type of the test for the run.
  • AWS Device Farm File Upload Time Out: Time out duration (seconds) for the test file upload. The step is skipped if the time out is reached.
  • Maximum Waiting Time for Run Test Results: Time 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.
  • AWS Device Farm App ARN: The 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.
  • AWS Device Farm App Upload File Name: The 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.
  • AWS Device Farm App Upload Type: The upload type of the file.
  • AWS Device Farm App Upload File Path: The file path for the app upload.
  • AWS Device Farm Test ARN: The 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.
  • AWS Device Farm Test Upload File Name: The test file to be uploaded. The file must have a .zip extension.
  • AWS Device Farm Test Upload Type: The upload type of the test.
  • AWS Device Farm Test Upload File Path: The file path for the test upload.
  • AWS Test Spec ARN: The ARN of the uploaded test spec to be run.
  • AWS Test Spec Upload File Name: The test spec file to be uploaded.
  • AWS Test Spec Upload Type: The upload type of the test spec.
  • AWS Test Spec Upload File Path:The file path for the test spec upload.

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

Running the Build with the AWS Device Farm Step

After you save your settings, you can run the build automatically with the triggers or run it manually and the step will be executed accordingly. You can view the details of the upload operation in the build logs:

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:

Building and deploying apps automatically for AWS Device Farm

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

An automated test run on AWS Device Farm

With Appcircle, you can automate the full lifecycle of your mobile app with continuous integration, continuous delivery and continuous testing.

Top comments (0)