AWS Device Farm
Developer Guide (API Version 2015-06-23)

Working with Calabash for Android and AWS Device Farm

Device Farm provides support for Calabash for Android.

Device Farm also provides a sample Android application and links to working tests in three Android automation frameworks, including Calabash. The Device Farm sample app for Android is available for download on GitHub.

What Is Calabash?

Calabash is a mobile testing framework that you can use to run automated user interface acceptance tests written in Cucumber on Android apps. For more information, see the Welcome to Calabash for Android repository on GitHub.

Version Information

Currently, Device Farm supports Calabash version 0.9.0.

Prepare Your Android Calabash Tests

Your Android Calabash tests must be contained in a .zip file with the following structure: `-- features (directory) |-- my-feature-1-file-name.feature |-- my-feature-2-file-name.feature |-- my-feature-N-file-name.feature |-- step_definitions (directory) | `-- (.rb files) |-- support (directory) | `-- (.rb files) `-- (any other supporting files)

Upload Your Android Calabash Tests

Use the Device Farm console to upload your tests.

  1. Sign in to the Device Farm console at

  2. In the list of projects, choose the option next to the project where you want to upload your tests.


    If the list of projects is not displayed, then on the secondary navigation bar, for Projects, choose the name of the project where you want to upload your tests.

    To create a project, follow the instructions in Create a Project.

  3. If the Create a new run button is displayed, choose it.

  4. On the Choose your application page, choose Upload.

  5. Browse to and choose your Android app file. The file must be an .apk file.

  6. Choose Next step.

  7. On the Configure a test page, choose Calabash, and then choose Upload.

  8. Browse to and choose the .zip file that contains your tests.

  9. Choose Next step, and then complete the remaining instructions to select devices and start the run.

Taking Screenshots in Android Calabash Tests

You can take screenshots as part of your Android Calabash tests.

Android Calabash provides a set of predefined steps for taking screenshots. For details, see the "Screenshots" section of the Canned steps page in the Calabash Android repository on GitHub.

Alternatively, you can define a custom step inside of a Ruby (.rb) file to call the screenshot_embed function, which creates a screenshot and saves it to a directory you define. For example, the following code example creates a screenshot and saves it to the /my/custom/path directory with a file name of screenshot_seconds-since-Epoch:

screenshot_embed(:prefix => "/my/custom/path", :name => "screenshot_#{}")

Additional Considerations for Android Calabash Tests

Device Farm replaces some Calabash hooks so that Android Calabash tests can run on devices in Device Farm, but it does not modify Android Calabash tests.