LogoLogo
πŸš€ Run Maestro tests in the cloud β†’
  • Home
  • Star us on GitHub
  • Getting Started
    • What is Maestro?
    • Installing Maestro
      • macOS
      • Windows
      • Linux
    • Build and Install your App
      • Android
      • iOS
    • Run a Sample Flow
    • Writing Your First Flow
    • Maestro Studio
    • Running Flows on CI
  • Cloud
    • Run Maestro tests in the cloud
    • Cloud Quickstart
    • CI Integration
      • GitHub Actions
        • Maestro GitHub Action for Android
        • Maestro GitHub Action for iOS
        • Maestro GitHub Action for Flutter
      • Bitrise
      • Bitbucket Pipelines
      • CircleCI
      • Integration with any CI platform
    • Pull Request Integration
    • Cloud Reference
      • Build your app for the cloud
      • Configuring OS Version
      • Configuring device locale
      • Device timezones
      • Email Notifications
      • Slack Notifications
      • Webhook Integration
      • Managing Secrets
      • Limits
      • Reusing App Binary
      • IP Allowlist
      • System Status
  • Platform Support
    • Supported Platforms
    • Android - Views
    • Android - Jetpack Compose
    • iOS - UIKit
    • iOS - SwiftUI
    • React Native
    • Flutter
    • Web Views
    • Web (Desktop Browser)
  • Examples
    • Android contacts flow automation
    • Facebook signup flow automation
    • Advanced: Wikipedia Android
    • Page Object Model
  • CLI
    • Cloud
    • Test Suites & Reports
    • Tags
    • Record Your Flow
    • Continuous Mode
    • View Hierarchy
    • Start Device
  • API Reference
    • Commands
      • addMedia
      • assertVisible
      • assertNotVisible
      • assertTrue
      • assertWithAI
      • assertNoDefectsWithAi
      • back
      • clearKeychain
      • clearState
      • copyTextFrom
      • evalScript
      • eraseText
      • extendedWaitUntil
      • extractTextWithAI
      • hideKeyboard
      • inputText
      • killApp
      • launchApp
      • openLink
      • pressKey
      • pasteText
      • repeat
      • retry
      • runFlow
      • runScript
      • scroll
      • scrollUntilVisible
      • setAirplaneMode
      • setLocation
      • startRecording
      • stopApp
      • stopRecording
      • swipe
      • takeScreenshot
      • toggleAirplaneMode
      • tapOn
      • doubleTapOn
      • longPressOn
      • travel
      • waitForAnimationToEnd
    • Common command arguments
    • Selectors
    • Configuration
      • Workspace configuration
      • Flow configuration
      • AI configuration
  • Advanced
    • Nested Flows
    • Wait
    • Loops
    • Conditions
    • Parameters & Constants
    • JavaScript
      • Run JavaScript
      • Outputs
      • Logging
      • Access element text
      • Make HTTP requests
      • GraalJS support
      • JavaScript announcement blog
    • Specify a Device
    • Configure Permissions
    • Detect Maestro in your app
    • Configure Maestro driver timeout
    • onFlowStart / onFlowComplete hooks
    • Test in different locales
    • Structuring your test suite
  • Troubleshooting
    • Known Issues
    • Frequently Asked Questions
    • Bug Report
    • Rollback Maestro
    • Debug Output
    • HOWTOs
      • Arrange your repository for Maestro tests
      • scrollUntilVisible for fragments
  • Community
    • Contributions
    • Articles & Tutorials
    • Case Studies
    • Resources
Powered by GitBook

Read to wire into CI or scale up your testing?

  • Run Maestro tests in the cloud β†’
On this page
  • Obtain the device identifier
  • Pass the device identifier to Maestro
  • Run flows in parallel
  • --shard-all
  • --shard-split

Was this helpful?

Edit on GitHub
  1. Advanced

Specify a Device

PreviousGraalJS supportNextConfigure Permissions

Last updated 8 months ago

Was this helpful?

If you have multiple devices open, you can specify which device to run Maestro on. To do this, you must first obtain the device identifier and then pass it to Maestro.

Obtain the device identifier

To list available Android devices, run the following command in your terminal:

adb devices

From the output, locate the device identifier for the device you want to use with Maestro.

To list available iOS simulators, run the following command in your terminal:

xcrun simctl list devices booted

From the output, locate the device identifier for the device you want to use with Maestro.

Pass the device identifier to Maestro

When running any Maestro command that requires a device (e.g. test or studio), you must first pass the device identifier with the --device parameter before running the command.

For example, to run Maestro Studio on an Android device with identifier emulator-5554 use the following command:

maestro --device emulator-5554 studio

Similarly, to run flow.yaml on an iOS simulator with identifier 5B6D77EF-2AE9-47D0-9A62-70A1ABBC5FA2 use the following command:

maestro --device 5B6D77EF-2AE9-47D0-9A62-70A1ABBC5FA2 test flow.yaml

Run flows in parallel

Maestro can run tests in parallel, also known as "sharding".

There are two sharding strategies available.

--shard-all

To run tests in parallel, you can use the --shard-all parameter. This parameter will run the same tests in parallel on available devices:

maestro test --shard-all 3 .maestro

--shard-split

Let’s say you have 3 running devices and 9 tests, but now you want to split this test suite into 3 chunks of tests and run them in parallel on connected devices:

maestro test --shard-split 3 .maestro

To run with --shard-all 3 or --shard-split, you need to have 3 available devices. If there are less, Maestro will print an error and request you to run more devices.