To create a custom skin, you need the following elements:
- A background image (background.png)
- A JSON file (skin.json)
All these elements have to be put in a new folder in ~/.Genymobile/Genymotion/skins (Linux, macOS) or %LOCALAPPDATA%\Genymobile\Genymotion\skins (Windows). For example: ~/.Genymobile/Genymotion/skins/my-phone-skin/ ~ /.Genymobile/Genymotion/skins/my-phone-skin/ or %localappdata%\Genymobile\Genymotion\skins\my-phone-skin\ %localappdata%\Genymobile\Genymotion\skins\my-phone-skin\
Background image The background image must be in PNG format and it must be named background.png . For example: background.png
JSON File Then you need to create a JSON file named skin.json , which contains the following information.
Name "JSON "name": string " name " : string This attribute allows you to give a name for your skin. After creation, you should find your skin in the Virtual device installation window if you want to create a new device with this skin:
Display JSON "display":{ "offset":{ "x": int, "y": int }, "size":{ "width": int, "height": int } } " display " : { " offset " :{ " x " : int , " y " : int }, " size " :{ " width " : int , " height " : int } } The display attribute sets the size and offset of your skin. offset This parameter sets the offset between your skin and the device display. size This parameter sets the width and height of the virtual device resolution.
Important The height and width of the background image must not be lower than height + offset x and width + offset y , or your skin will not be valid and you will get a BACKGROUND_FORMAT_ERROR error.
Resize Margins JSON "resizeMargins": { "left": int, "top": int, "right": int, "bottom": int } " resizeMargins ": { " left " : int , " top " : int , " right " : int , " bottom " : int } The resizeMargins attribute defines the resizable margins of the window. Note that the window will only be resizable from bottom and left sides, but you still need to define the other sides in case the virtual device is rotated.
Example Content of the skins folder: ~/.Genymobile/Genymotion/skins/skin-test/ ├── background.png └── skin.json Content of skin.json : JSON { "name": "skin-test", "display": { "offset": { "x": 150, "y": 150 }, "size": { "width": 720, "height": 1280 } }, "resizeMargins": { "left": 75, "top": 75, "right": 75, "bottom": 75 } } { " name " : " skin-test " , " display " : { " offset " :{ " x " : 150 , " y " : 150 }, " size " : { " width " : 720, " height " : 1280 } }, " resizeMargins " : { " left " : 75, " top " : 75, " right " : 75, " bottom " : 75 } } Here is a diagram explaining precisely each parameters from skin.json:
Prev Previous Aplitools Visual Tests with Genymotion SaaS Next Use Burp Suite with Genymotion Desktop Next
Background image The background image must be in PNG format and it must be named background.png. For example: background.png
JSON File Then you need to create a JSON file named skin.json, which contains the following information.
Name "JSON "name": string " name " : string
This attribute allows you to give a name for your skin. After creation, you should find your skin in the Virtual device installation window if you want to create a new device with this skin:
Display 1. Copy the sample skin.json contents into your skin.json. 2. Save in the same folder as background.png.
Resize Margins 3. The resizeMargins attribute defines the resizable margins of the window. Note that the window will only be resizable from bottom and left sides, but you still need to define the other sides in case the virtual device is rotated.
Example
Content of the skins folder:
~/.Genymobile/Genymotion/skins/skin-test/
├── background.png
└── skin.json
Content of skin.json:
{
"name": "skin-test",
"display": {
"offset": {
"x": 150,
"y": 150
},
"size": {
"width": 720,
"height": 1280
}
},
"resizeMargins": {
"left": 75,
"top": 75,
"right": 75,
"bottom": 75
}
}
Here is a diagram explaining precisely each parameters from skin.json:
[Images illustrating parameters]
Background image
Display
Resize Margins
Example
Content of the skins folder:
~/ .Genymobile/Genymotion/skins/skin-test/ ├── background.png └── skin.json
Content of skin.json:
[JSON code block above]
Here is a diagram explaining precisely each parameters from skin.json:
[Graphic diagrams of skin.json parameters]
Background image Display Resize Margins Example
[END OF CONTENT]