Use Bitrise with Genymotion SaaS

Bitrise and Genymotion SaaS integration illustration

When it comes to testing mobile apps, especially in a highly Android dominant fragmented mobile market, it becomes challenging to perform quick and efficient tests. Mobile DevOps encourages the use of multiple mobile devices in the Cloud to tackle this challenge.

With Genymotion SaaS (Cloud), QA engineers can spawn many Android virtual devices in the Cloud in parallel and test at scale. With Bitrise, a Continuous Integration & Delivery platform dedicated to mobile apps, users can use a powerful UI to create workflows easily, which then can build, test and deploy an app and improve efficiency by setting up the whole mobile application dev lifecycle environment.

Genymotion SaaS is now available on Bitrise, so QA engineers can now easily choose the Genymotion SaaS Android virtual devices to run their tests on them using any testing framework (Espresso, Appium and so on). No need to learn how to use the Genymotion SaaS command-line tool to automate the start/stop of the devices: everything can be handled in the UI.

In this article, we are going to cover Appium written tests but you can also use any other testing framework.

Connect your Android project to Bitrise

Adding an application to Bitrise is really simple; please refer to the official documentation for details.

After having connected your Android application to bitrise.io, a workflow is created with several default Android steps. The following screenshot shows the default workflow:

Bitrise console

Build an Android application

In order to run Appium tests, you need to build your Android application. So let’s add the “Android build” step to your workflow. When this step is executed, the APK path is pushed to an environment variable ( $BITRISE_APK_PATH ) which we will use later when we run the tests.

Bitrise console: adding an "Android build" step.

Install and start an Appium server

We will use the “Script” step to install and start an Appium server.

As it is a Bash script, it allows you to start an Appium server with the needed capabilities, the arguments are described here.

Bitrise console: adding a "Script" step.

Add Genymotion SaaS start instances step

This step starts one or several devices on the Genymotion SaaS platform

Bitrise console: adding a "Genymotion Cloud Start" step.

This step has several required parameters:

  • Genymotion SaaS account email (required): it is the email of your Genymotion SaaS account; if you don’t have an account, please create it first on https://cloud.geny.io.
  • Genymotion SaaS password (required): it is the password for your Genymotion SaaS account.
  • Recipe UUID (required): Recipe UUID is the identifier used when starting an instance, it can be retrieved using gmsaas recipes list command line. The comprehensive list of all currently available recipes UUIDs are available here.
  • ADB serial port (optional): it is the port through which the instance will be connected to ADB, for example: localhost:adb_serial_port.

Run tests

In this tutorial, we use an Android application with Appium tests written in Python. Source code is public and available on Github. Even if you use another language, the logic is the same.

Bitrise console: adding a step to run tests.

Here, we will add another “Script” step which:

  • Installs all dependencies
  • Starts the command executing tests. As you can see in the following screenshot, we use the environment variable $BITRISE_APK_PATH which has been exported in the Android build step.

Add Genymotion SaaS stop instances step

This step will stop all Genymotion SaaS instances started in the “start” step. This step will always run to make sure that no instances are left running in case a previous step fails the build.

No need to change the input variable “Instance UUID”, it is automatically exported in the “start” step.

Bitrise console: adding a stop step.

Conclusion

At the end of this tutorial, you should be able to create a complete Continuous Integration workflow for your application, including unit and UI testing.

You can improve your workflow by adding other steps in order to deliver your application, but this is another story 🙂 You can find more information here.

If you have any questions, feel free to submit a request from Genymotion SaaS platform. To find more information, do not hesitate to read our documentation.

Genymotion SaaS steps are open-source, so feel free to create an issue or contribute https://github.com/Genymobile/bitrise-step-genymotion-cloud-saas-start and https://github.com/Genymobile/bitrise-step-genymotion-cloud-saas-stop

The Android application code sample used in this tutorial is available on Github.

Last but not least, enjoy your Bitrise CI/CD workflow with Genymotion SaaS!

Table of Contents

Select Product Portal

SaaS Platform

Access to our SaaS solution and use virtual machines in the cloud on any web browsers.

Or

Or

Desktop Platform

Access to manage your Genymotion Desktop licenses, your invoices and account information.

Select a Cloud provider Marketplace

How to get a quote for multiple Business Licenses?

  1. You need a Genymotion Desktop account. If you haven’t one yet, you can create it here.
  2. After creation and activation, or if you already have an account, follow this link.
  3. Add the number of desired licenses to your shopping cart and click “Continue to Billing”
  4. Add a shipping address, or select one if you already created one.
  5.  In the next page, click “Get a quote”:
    Payment details
  6. A quote will be automatically generated in PDF format.

Genymotion Device Image for Cloud providers
- Private Offer -

Genymotion Device On-premise
- Contact Us -

Genymotion SaaS
- Increase Maximum Simultaneous devices -

Genymotion SaaS Enterprise Plan
- Get a Quote -

Genymotion SaaS Premium Plan
- Get a Quote -

Personal Use - Free

Genymotion Desktop for personal use is not suitable for trial or POC: you will not get any assistance and some features will be disabled. If you have already selected “personal use” and wish to get a trial license, please contact our Sales at [email protected].

Technical support is not available with Genymotion Desktop free edition for personal use. For more details, please refer to Genymotion conditions of use (Personal Use).

The following features are not available in personal use mode:

Follow these steps to get Genymotion Desktop and activate personal use mode:

  1. Go to the Download page and get the latest version for your system.
  2. Follow the instructions from Genymotion Desktop quickstart guide to install Genymotion Desktop.
  3. Launch Genymotion and click CREATE to create an account. You should receive an activation email within an hour. If not, make sure to check your spam.
  4. After activating your account, return to Genymotion and log in with your credentials.
  5. Select personal use when prompted.
  6. Read Genymotion Desktop quickstart guide carefully to setup Genymotion for your needs.

Indie Plan Application Form

This plan is strictly reserved to individual workers (freelancers, self-employed).

Educational Plan Application Form

The Educational plan is restricted to:

  • schools, teachers or students who wish to use Genymotion Desktop for tuition
  • students who wish to use Genymotion Desktop for a school project

It is subject to valid proof (student card, teacher card, etc.)