Skip to content

Create android emulator on demand

This is the beta version of the feature

  • Some functionality or APIs might slightly change in the future
  • Some functionality might be unstable
  • Available from Emcee 21.2.0 version

Emulators resource consumption

  • New emulators will require a lot of disk space and will require higher CPU and RAM resources (more than default resource setup)

By default worker has ability to use preconfigured emulator with limited configuration (low screen resolution and density).

If you want to use emulator with other screen resolution or density you can configure this params.

Worker then will create emulator dynamically and will reuse emulator with this configuration till pod with worker will be destroyed.

For now it is possible to configure:

  • screen resolution
  • screen density
  • android SDK API level

Worker container resources in case of dynamic emulator usage#

Keep in mind that emulator with bigger screen resolution and density or with higher SDK version consume more resources.

In this case we recommend to increase CPU and RAM resources if you will use dynamic emulators.

For example, if you will use emulator with full hd resolution and 440dpi density you can limit worker pod with 4.5 CPU and 6GB RAM resources.

Configure dynamic emulator usage#

To use this feature configure device field in clients. Instead of default type use dynamic device type.

CLI example:

tests:
  configurations:
    - platform: android
      appApk: /path/to/app-debug.apk
      testApk: /path/to/app-debug-androidTest.apk
      devices:
        - sdkVersion: 31
          deviceType: dynamic
          screenResolution: SCREEN_1920x1080 # available: SCREEN_480x320, SCREEN_1280x720, SCREEN_1920x1080
          screenDensity: DPI_440 # available: DPI_120, DPI_320, DPI_440

Gradle plugin example:

import com.avito.emcee.queue.DeviceScreenDensity
import com.avito.emcee.queue.DeviceScreenResolution
import com.avito.emcee.queue.DeviceType

emcee {
    // ...
    devices {
        addDevice(
            sdk = 31,
            type = DeviceType.DYNAMIC,
            screenResolution = DeviceScreenResolution.SCREEN_1920x1080,
            screenDensity = DeviceScreenDensity.DPI_440
        )
    }
    // ...
}