Configuring Device Pools
A device pool contains the configuration and specification about the devices that are used to run tests on your app source code. Based on your device pool, at run time, AWS Device Farm selects a set of devices from a list of available devices in a region or location. You can create, update, and delete device pools for your App Factory projects. You can also create multiple device pools for your App Factory projects.
You can use device filters to define the type of devices that you want to include in the device pool. You can also the set the maximum number of devices in your pool. A filter consists of an attribute, an operator, and an operand (which can contain one or more values). These attributes are based on device specifications such as OS Version, Platform, and Manufacturer. For example: you can create a filter for Android devices that run on OS versions between 8.0 and 10.
Why use device filters?
Creating a pool by using device filters gives users an advantage over selecting specific devices, as these dynamic pools can adapt when new devices become available. During an App Factory run, the device pool is passed to AWS Device Farm, which selects the best possible set of devices that match the specifications of the pool. This results in faster allocation of devices and reduced number of timeouts that are caused due to indefinite waiting for devices.
Components of a filter
- Attribute: Specifies the aspect of a device (such as the platform, model, or OS version) that is used as the selection criteria in a device filter.
- Operator: Specifies how the attribute must be compared with the operand.
- Operand: Specifies a set of one or more values that corresponds to the Attribute that is used in the filter.
For more information about filters, you can refer to the following table.
Attributes | Operators | Operands |
---|---|---|
AVAILABILITY: Specifies whether the device is currently available. | EQUALS | AVAILABLE; HIGHLY_AVAILABLE |
MANUFACTURER: Specifies the manufacturer of the device. | EQUALS; IN; NOT IN | Apple; Samsung; etc For the IN and NOT IN operators, you can provide multiple values by separating them with a comma (,) Note: Results are provided only for valid manufacturer names. |
MODEL: Specifies the model of the device. | CONTAINS; EQUALS; IN; NOT IN | Apple iPhone 11; Google Pixel 2; etc For the IN and NOT IN operators, you can provide multiple values by separating them with a comma (,) Note: For operators such as EQUALS and IN, results are provided only for valid model names. |
OS VERSION: Specifies the version of the operating system of the device. | EQUALS; IN; NOT IN; GREATER THAN; GREATER THAN OR EQUALS; LESS THAN; LESS THAN OR EQUALS | 10.3.2; 9; 7.1; etc For the IN and NOT IN operators, you can provide multiple values by separating them with a comma (,) |
For more information about creating and managing device pools, refer to the following sections.
Creating a Device Pool
- From your project folder, navigate to the Tests folder.
- In the Tests folder, verify that you see the jobs that are displayed in the following screenshot.
- For the managePool job, click the Build with Parameters icon.
-
For the DEVICE_FILTER parameter, click CREATE NEW DEVICE POOL. App Factory displays additional fields that you need to configure for the DEVICE_FILTER parameter.
Alternatively, you can select an existing device pool to edit and update its configuration.Note: For earlier versions, you need to use the POOL_NAME and DEVICE_LIST parameters to create a device pool. For more information, refer to Creating Device Pools.
-
Click ADD RULE. The Create New Rule window opens.
- On the Create New Rule window, select a platform from the drop-down list. For example: Android - Mobile
- After you select a platform, click ADD. App Factory displays additional fields for the rule.
- Configure the fields based on your preference. You can add multiple filters by adding more fields for the platform.
-
After you configure the fields, click the plus icon on the right side of the row. A new row is created that you can use to specify more filters.
The list of devices updates every time you add a new filter.
Note: You can also set the maximum number of devices on which you want to run your tests. App Factory uses a public pool, therefore, a limit of 5 devices exists for every platform that can be selected for your rules.
-
After you add filters for the required platforms, from the lower-right corner of the Create New Rule window, click SAVE DEVICE RULES.
The landing page displays the name of the pool and an edit option. The page also displays a table that contains the cumulative result of the devices that match your rules.
-
After configuring the name and the rules, click BUILD.
When the device pool BUILD is complete, the managePool job passes successfully. After the job passes, you can verify the build status as shown in the following screenshot (Build #1 is green and marked as successful). A new device pool is created, which you can use to run tests within the build pipeline or separately.
Updating a Device Pool
- From your project folder, navigate to the Tests folder.
- For the managePool job, click the Build with Parameters icon.
-
For DEVICE_FILTER parameter, from the Select Existing Pool list, select a device pool.
The console displays the name of pool and an edit icon. The console also displays the cumulative list of devices that match the rules that are defined in the pool.Note: Device pools that were created before V9 ServicePack 1 do not contain rules or filters. Therefore, the console does not display any results.
However, you can upgrade the device pool by editing it and adding rules. -
For the selected pool, click the edit icon. The Edit Rules window appears.
-
The Edit Rules window displays the pre-existing filters and the max devices in the pool. Add platforms and filters based on your requirement.
- To add a new platform, select a platform from the drop-down list, and then click ADD.
- To add a filter for an existing platform, in the row of the filter that was last created, click the plus icon.
-
After you add filters for the required platforms, from the lower-right corner of the Edit Rules window, click SAVE DEVICE RULES.
- After you edit the rules and filters, click BUILD.
When the device pool BUILD is complete, the managePool job build passes and you can see the status of the update operation in the build description.
Note:
- To update a device pool for projects that were created before V9 ServicePack 1, you need to remove the device pool and create a new device pool with the same name.
- If you upgrade your projects by recreating them in V9 ServicePack 1, the POOL_NAME and DEVICE_LIST parameters will not be available for device pools.Any existing pools will still be available for use.
- If you upgrade the device pool, it is overwritten to have device filters and no longer contains a static set of devices.
Removing a Device Pool
A device pool can be removed when it is outdated or obsolete. To remove a device pool, follow these steps:
- From your project folder, navigate to the Tests folder.
- For the managePool job, click the Build with Parameters icon.
- Under Remove Pool, from the AVAILABLE_TEST_POOLS list, select the device pool that you want to remove.
- After selecting a device pool, click BUILD.
After the build passes, verify that the build status is successful as shown in the following screenshot.
Reference: Creating Device Pools (V9 or earlier)
If you are using Volt MX and App Factory V9 (or earlier), you need to create a device pool by using the POOL_NAME and DEVICE_LIST parameters.
Parameter | Description |
---|---|
POOL_NAME | Specifies the name of the device pool. The name is used to identify and select the device pool while triggering a build job or a test job. |
DEVICE_LIST | Specifies a list of devices for different platforms, vendors, and models. The name of the device contains the following details: Device type, such as phone or tablet Platform, such as Android or iOS Vendor, such as Motorola or Apple Model, such as Nexus 6 or iPhone 8 OS version such as 8.0 |