Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Specify devices using regular expressions (regex)

Specify Android and iOS devices using regular expressions (regex) for your Flutter test executions on BrowserStack App Automate.

You can use regular expressions (regex) to select devices to test on instead of providing specific device models in the devices parameter using the builds REST API. Based on the regex you pass, the first available device is allocated from the device pool that matches your specifications. By widening your search through regular expressions, you get better test execution speed by reducing queuing and device tier limits.

Choose the OS version of your choice to specify devices using regex:

The following table provides information on how to use regular expressions for specifying device attributes, using the builds REST API:

Parameter Description Sample values
devices Required
- device is required.
- os_version is optional. The latest OS version is allocated for the device model if you do not pass this key.
"devices": [{ "device": "Samsung Galaxy.*", "os_version": "[89]"}, {"device": "Google Pixel 3$", "os_version": ".*"}]
Samsung .* allocates any Samsung device,
Google Pixel 3$ allocates Google Pixel 3 only.

Refer to the supported devices list to select an Android device of your choice.

Example cURL request where a regular expression has been used to specify tests to run on any 2 Galaxy devices with OS version 11.0:

Terminal
Copy icon Copy

Here are some use cases of using regular expressions to specify device attributes:

Use case Number of parallels consumed Parameter structure
Run test suite on any Galaxy device with OS version 11.0 1 "devices": [{"device": "Samsung Galaxy .*", "os_version": "11.0"}]
Run test suite on any 2 Galaxy devices with OS version 11.0 2 "devices": [{"device": "Samsung Galaxy .*", "os_version": "11.0"}, {"device": "Samsung Galaxy .*", "os_version": "11.0"}]
Run test suite on any 1 Galaxy device with OS version 11.0 and any 2 Android 8 or Android 9 devices 3 "devices": [{"device": "Samsung Galaxy .*", "os_version": "11.0"}, {"device": ".*", "os_version": "[89]"}, {"device": ".*", "os_version": "[89]"}]

The following table provides information on how to use regular expressions for specifying device attributes, using the builds REST API:

Parameter Description Sample values
devices Required
- device is required.
- os_version is optional. The latest OS version is allocated for the device model if you do not pass this key.
"devices": [{ "device": "iPhone.*", "os_version": "1[56]"}]
This allocates any iPhone device with OS version 15 or 16.

Refer to the supported devices list to select an iOS device of your choice.

Example cURL request where a regular expression has been used to specify tests to run on any 2 iPhone devices with OS version 15 or 16:

Terminal
Copy icon Copy

Here are some use cases of using regular expressions to specify device attributes:

Use case Number of parallels consumed Parameter structure
Run test suite on any iPhone 14 models with OS version 16 1 "devices": [{"device": "iPhone 14.*", "os_version": "16.0"}]
Run test suite on any 2 iPhone 14 models with OS version 16 2 "devices": [{"device": "iPhone 14.*", "os_version": "16.0"}, {"device": "iPhone 14.*", "os_version": "16.0"}]
Run test suite on any 1 iPhone 14 model with OS version 16 and any 2 iOS devices with OS version 15 or 16 3 "devices": [{"device": "iPhone 14.*", "os_version": "16.0"}, {"device": ".*", "os_version": "1[56]"}, {"device": ".*", "os_version": "1[56]"}]

Once you start the Flutter test execution, you can access the test execution results on the App Automate dashboard.

  • Manage your uploaded apps/test packages using our REST API (Android/iOS).

  • Use the recent apps API endpoint list recent builds API (Android/iOS) to list your recently uploaded apps.

  • Delete your uploaded apps/test packages using the delete API endpoint (Android/iOS).

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle