Device profiles

A device profile describes the phone Vetro builds: its screen size and density, its memory, and a few details the system shows to apps, such as the serial number and the device name. The normal page always uses the default, Light (landscape). To pick another one, add it to the app's address (app/?profile=phone), or open the full setup form with app/?advanced=1 and choose it in the Device profile menu before Start.

The profiles that come with Vetro

ProfileScreenDensityMemoryNotes
Light (landscape)960 x 600180 dpi2 GiBselected by default: the same layout as full resolution with about half the pixels to draw, so the phone answers sooner; ready-made snapshot
Full resolution (landscape)1280 x 800240 dpi2 GiBsharper, slower to draw; ready-made snapshot
Phone720 x 1280, portrait320 dpi2 GiBa typical 5-inch phone (360 x 640 dp)
Small phone480 x 800, portrait240 dpi1.5 GiBa small, low-memory phone (320 x 533 dp)
Tablet1280 x 800, landscape213 dpi2 GiBwide enough (600 dp) for apps to use their tablet layouts

With a profile other than the two landscape ones, the first start is a cold boot of about 45 minutes, because ready-made snapshots are published only for those. From then on that profile resumes in seconds like any other: each profile keeps its own saved phone (see Snapshots and saved data).

The Phone profile: the top of the home screen in portrait, 720 x 1280 at 320 dpi, captured under Vetro

What a profile changes

Some things cannot change without a new system image, among them the model, brand and manufacturer names apps read from Build.MODEL and friends (they say "Vetro"), and the language at the very first start.

Your own profile

A profile is a small JSON file. Write one, open the setup form (app/?advanced=1), click load a profile file and pick it; it is added to the menu. A built-in profile needs no form: open the app with ?profile=phone (or small-phone, tablet, default) in the address.

{
  "vetroProfile": 1,
  "id": "my-phone",
  "name": "My phone",
  "description": "A 6-inch phone in portrait.",
  "screen": { "width": 1080, "height": 2340, "density": 420 },
  "ramMiB": 3072,
  "locale": "it-IT",
  "timezone": "Europe/Rome",
  "device": { "name": "Test phone", "serial": "TEST0001", "sku": "test" }
}
FieldRequiredWhat it is
vetroProfileyesthe format version: 1
idyesa short name: lowercase letters, digits and dashes
nameyesthe name shown in the menu
descriptionnoone line shown under the menu
screen.width, screen.heightyespixels, even numbers from 320 to 3840
screen.densityyesdpi, from 120 to 640
ramMiByesmemory in MiB, from 1024 to 3072, a multiple of 64
localenoa language tag such as en-US or it-IT (default en-US)
timezonenoa time zone such as Europe/Rome or UTC
device.namenothe device name in Settings
device.serialnothe serial number: letters and digits, up to 20
device.skunothe SKU: letters, digits, dots, dashes, underscores

Vetro checks the file strictly: an unknown field, a value out of range or a newer format version is an error, shown in the status line, so a typo never changes the phone silently.

Large screens cost memory and speed: every frame has more pixels to draw on an emulated processor. The built-in profiles are a good balance.

From the command line

The native runner accepts the same profiles:

vetro boot --boot-img boot.img --vendor-boot vendor_boot.img --init-boot init_boot.img \
  --disk disk.img --profile phone        # or --profile my-profile.json

It prints the adb commands for the settings applied after the boot (time zone, device name, language). The file format is described for developers in docs/specs/device-profiles.md in the repository.