User Data Parameters

You can use , to configure instance settings during your deployment process:

> Warning: Not available for all Android versions. Check for more details.

More parameters will be added in the future.

Parameters and code

User parameters are in JSON format: { "parameter": "value" }.

Supported objects and parameters are as follows.

Top-level parameters

| Key/Object | Type | Description | Default | |---|---|---|---| | applyEveryBoot | Boolean | If true, parameters values are applied after every boot. | false | | configuration | Object | Instance specific configuration (see ) | {} | | hwProfile | Object | Virtual device specific configuration (see ) | {} | | user_dns | String | Domain name for SSL certificate. | |

configuration object

| Key (Parameter) | Type | Description | Default | |---|---|---|---| | root.active | Boolean | If true, the device is "rooted". | false | | adb.active | Boolean | If true, ADB access is enabled for the device. | false | | authentication.enable | Boolean | If true, authentication is required. | true | | authentication.username | String | Sets a username (SHA-1)*. | | | authentication.password | String | Sets a password (SHA-1)*. | |

*The username and password objects values must be strings encoded in SHA-1.

For example, if you wish to set "genymotion" username with "genYm01!" password:

1. Encode the strings into SHA-1: 2. Copy and paste the SHA-1 strings in your JSON:

Example commands:

$ echo "n "genymotion" | openssl sha1 (stdin)= 0db0f30519f66ad6c9f4b42df56a7e08102e8374

$ echo "n "genYm01!" | openssl sha1 (stdin)= 2eaa80a32c113dfe583f3d6120425fec54b89dd8

JSON example for configuration:

{
  "configuration": {
    "authentication": {
      "enable": "true",
      "username": "0db0f30519f66ad6c9f4b42df56a7e08102e8374",
      "password": "2eaa80a32c113dfe583f3d6120425fec54b89dd8"
    },
    "root": {
      "active": "true"
    },
    "hwProfile": {
      "displaySettings": {
        "displays": [
          {
            "width": 768,
            "height": 1280,
            "density": 160,
            "contentPadding": 125,
            "topCornerRadius": 125,
            "bottomCornerRadius": 0
          }
        ]
      }
    },
    "user_dns": "genymotion.com"
  }
}

hwprofile object

| Key (Parameter) | Type | Description | Default | |---|---|---|---| | displaySettings.displays | Array | Device display settings. | {} | | width | Integer | Display width (px). | 600 | | height | Integer | Display height (px). | 1024 | | density | Integer | Display density (ddp). | 180 | | contentPadding | Integer | Display padding (px). | 0 | | topCornerRadius | Integer | Radius of the top display rounded corners. | 0 | | bottomCornerRadius | Integer | Radius of the bottom display rounded corners. | 0 |

JSON Example

{
  "applyEveryBoot": true,
  "configuration": {
    "adb": {
      "active": true
    },
    "authentication": {
      "enable": true,
      "username": "0db0f30519f66ad6c9f4b42df56a7e08102e8374",
      "password": "2eaa80a32c113dfe583f3d6120425fec54b89dd8"
    },
    "root": {
      "active": true
    }
  },
  "hwProfile": {
    "displaySettings": {
      "displays": [
        {
          "width": 768,
          "height": 1280,
          "density": 160,
          "contentPadding": 125,
          "topCornerRadius": 125,
          "bottomCornerRadius": 0
        }
      ]
    }
  },
  "user_dns": "genymotion.com"
}

Usage by provider

Each Cloud provider has its own way to handle user data parameters. Please follow these tutorials to learn how to use them.

When creating an instance

The parameters can be set when , in the Advanced details section at step 3 ( Configure Instance ).

You can then copy and paste your code, or import a file containing the code in JSON format.

The parameters can only be set from an existing instance when it is stopped. See below.

The parameters can be set when , in the Management > Metadata section:

1. Click ADD ITEM 2. In the Key field, input the string genymotionConfig 3. In the Value field, copy and paste your JSON code: 4. Create your instance.

Your parameters will be displayed in the VM instance details, in the Custom metadata section:

> Warning: This feature is not available on Azure.

In an existing instance

Make sure the instance is stopped and go to Actions > Instance Settings > Edit user data:

You can then copy and paste your code, or import a file containing the code in JSON format.

AWS steps:

1. From the Aliyun console, go to Elastic Compute Service > Instances & Images > Instances 2. Click on a stopped instance to access its details: 3. Click on All Operations and select Set user data: 4. Copy and paste your JSON code: 5. Click Ok to apply the parameters.

GCP steps:

Stop the instance if it is running and follow these steps:

1. In VM instance details, click EDIT 2. In Custom metadata, click Add item 3. Set the Key to genymotionConfig and copy and paste your JSON code in the Value field: 4. Click Save

> Warning: This feature is not available on Azure.