> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# genymotion/genymotion-saas

Start Genymotion Android virtual device, connect through ADB and stop device on Genymotion Cloud SaaS for mobile automation testing.


## Commands

### setup

Download gmsaas cli and authenticate the user.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api_token` | env_var_name | GMCLOUD_SAAS_APITOKEN | API Token of your Genymotion Cloud SaaS account. Set this to the name of the environment variable: GMCLOUD_SAAS_APITOKEN. |
| `gmsaas_version` | string |  | Install a specific version of gmsaas, default is the latest |

### start-instance

Start Android instance on Genymotion Cloud SaaS


| Parameter | Type | Default | Description |
|---|---|---|---|
| `adb_serial_port` | integer | -1 | ADB serial port to use when the instance is connected to ADB. |
| `recipe_uuid` | string |  | Instance recipe to use. Recipes can be listed with command line 'gmsaas recipes list',
or check https://support.genymotion.com/hc/en-us/articles/360007473658-Supported-Android-devices-templates-for-Genymotion-Cloud-SaaS
for a comprehensive list of all currently available recipes UUIDs.
 |

### stop-instance

Stop Android instance on Genymotion Cloud SaaS


| Parameter | Type | Default | Description |
|---|---|---|---|
| `instance_uuid` | string | $INSTANCE_UUID | Instance to stop. The UUID of the instance to stop is automatically retrieved. No need to set manually. |

## Jobs

### run_tests

Start Android instance, test your app and stop instance.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `adb_serial_port` | integer | -1 | ADB serial port to use when the instance is connected to ADB. |
| `recipe_uuid` | string |  | Instance recipe to use. Recipes can be listed with command line 'gmsaas recipes list',
or check https://support.genymotion.com/hc/en-us/articles/360007473658-Supported-Android-devices-templates-for-Genymotion-Cloud-SaaS
for a comprehensive list of all currently available recipes UUIDs.
 |
| `steps` | steps |  | Steps to execute once the Genymotion Cloud SaaS instance is available |
| `tag` | string | 2024.11.1 | Pick a specific circleci/android image tag: https://hub.docker.com/r/cimg/android/tags
 |

## Executors

### default

Android SDK tools are required for this orb, so we will use Circle CI image for Android: https://hub.docker.com/r/cimg/android/tags


| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 2024.11.1 | Pick a specific android image tag: https://hub.docker.com/r/cimg/android/tags
 |

## Examples

### override-credentials

How to :
 - Configure your Genymotion Cloud SaaS account by overriding default credentials (GMCLOUD_SAAS_APITOKEN environment variables).
   In this example, you can use API TOKEN credentials which have been set as environment variables.
   Credentials must be set as environment variables.
- Start Android instance, test your app and stop instance.


```yaml
version: '2.1'
orbs:
  genymotion-saas: genymotion/genymotion-saas@x.y
jobs:
  build:
    executor: genymotion-saas/default
    steps:
      - genymotion-saas/setup:
          api_token: API_TOKEN
      - genymotion-saas/start-instance:
          recipe_uuid: ''
      - run: echo "Run your tests here"
      - genymotion-saas/stop-instance
workflows: null
```

### specify-adb-serial-port

How to : - Configure your Genymotion Cloud SaaS account. Credentials are set as environment variables (GMCLOUD_SAAS_EMAIL & GMCLOUD_SAAS_PASSWORD) - Start Android instance, connect through ADB with a specific ADB serial port, test your app and stop instance.


```yaml
version: '2.1'
orbs:
  genymotion-saas: genymotion/genymotion-saas@x.y
jobs:
  build:
    executor: genymotion-saas/default
    steps:
      - genymotion-saas/setup
      - genymotion-saas/start-instance:
          adb_serial_port: ''
          recipe_uuid: ''
      - run: echo "Run your tests here"
      - genymotion-saas/stop-instance
workflows: null
```

### start_stop

How to : - Configure your Genymotion Cloud SaaS account. Credentials are set as environment variables (GMCLOUD_SAAS_EMAIL & GMCLOUD_SAAS_PASSWORD) - Start Android instance, test your app and stop instance.


```yaml
version: '2.1'
orbs:
  genymotion-saas: genymotion/genymotion-saas@x.y
jobs:
  build:
    executor: genymotion-saas/default
    steps:
      - genymotion-saas/setup
      - genymotion-saas/start-instance:
          recipe_uuid: ''
      - run: echo "Run your tests here"
      - genymotion-saas/stop-instance
workflows: null
```

### start_stop_with_job

Easily start and stop Genymotion Cloud Saas instance with a single job supplied by this orb.


```yaml
version: '2.1'
orbs:
  genymotion-saas: genymotion/genymotion-saas@x.y
workflows:
  basic_workflow:
    jobs:
      - genymotion-saas/run_tests:
          recipe_uuid: c52fdfc2-6914-4266-aa6e-50258f50ef91
          steps:
            - run: echo "run your test here"
      - genymotion-saas/run_tests:
          adb_serial_port: 12345
          recipe_uuid: c52fdfc2-6914-4266-aa6e-50258f50ef91
          steps:
            - run: echo "run your test here"
```