Automate instance parameters¶
Warning
This feature is not available with MS Azure and Oracle Cloud Infrastructure providers.
This chapter covers alternative methods to modify instances settings to ease deployment and post-deployment configuration.
To do so, we will be using the user data parameters , to set or modify the following parameters:
- Virtual Device resolution and dpi
- ADB connection (enable/disable)
- Authentication
- Domain name for SSL certificate
More parameters will be added in the future.
Parameters and code¶
User parameters are in JSON format: { "parameter": "value" }
. Supported parameters and values are:
Parameter | Description | Type | Default |
---|---|---|---|
applyEveryBoot | Apply parameters values after every boot. | Boolean | false |
configuration | Set ADB and authentication parameters. | JSON Object | |
adb | ADB parameters. | JSON Object | |
adb.active | Disable or enable ADB. | Boolean | false |
authentication | Configure authentication. | JSON Object | |
authentication.enable | Enable authentication. | Boolean | true |
authentication.username | Set a username. | String (SHA-1) | |
authentication.password | Set a password. | String (SHA-1) | |
hwProfile | Set Virtual Device hardware settings. | JSON Object | |
screens | Set Virtual Device display settings. | JSON Array | |
screens.width | Set Virtual Device display width. | Integer | 600 |
screens.height | Set Virtual Device display height. | Integer | 1024 |
screens.density | Set Virtual Device display density. | Integer | 160 |
user_dns | Set a domain for SSL certificate. | String |
Warning
username
and password
must be encoded in SHA-1.
For example, if you wish to set "genymotion" for username and "genYm01!" for password:
$ echo -n "genymotion" | openssl sha1
(stdin)= 0db0f30519f66ad6c9f4b42df56a7e08102e8374
$ echo -n "genYm01!" | openssl sha1
(stdin)= 2eaa80a32c113dfe583f3d6120425fec54b89dd8
In your JSON:
For example:
{
"applyEveryBoot": true,
"configuration": {
"adb": {
"active": true
},
"authentication": {
"enable" : true,
"username": "0db0f30519f66ad6c9f4b42df56a7e08102e8374",
"password": "2eaa80a32c113dfe583f3d6120425fec54b89dd8"
}
},
"hwProfile": {
"screens": [ {
"width": 768,
"height": 1280,
"density": 160
}
]
},
"user_dns": "genymotion.com"
}