Skip to main content
Prerequisites: These tests must exist locally as YAML files.
Run Momentic mobile tests in the current project. By default, tests will output results to a local directory. You can then upload them to Momentic dashboard using the momentic-mobile results upload command.
npx momentic-mobile run [options] [tests...]

Arguments

[tests...]
array
The tests to run. If not specified, selects all tests in the current project. You can specify multiple tests separated by spaces, test paths, or folder paths. You can also pass substrings to match test names.

Options

-c, --config <config>
string
Path to the Momentic configuration file. Defaults to momentic.config.yaml in the current directory.
-y, --yes
boolean
Skip all confirmation prompts. Defaults to true in CI.
--env <env>
string
Override the default environment for all tests during this run. The environment name should exist in your Momentic project configuration. Takes precedence over the default environment configured at the test level.
--name <name>
string
Name to associate with this run for easier identification in the Momentic dashboard. Also used as the base filename for generated reports.
--channel <channel>
string
Override the default release channel for APK selection during this run (e.g., staging, dev). If omitted and no default channel is configured on the test, Momentic will not install an APK on emulator initialization.
--tag <tag>
string
Override the version tag within the selected channel for APK selection. If omitted, each test uses the default tag configured, or the latest uploaded APK in the channel if no default exists.
-p, --parallel <parallel>
string
Number of tests to run in parallel. Defaults to 1.
--timeout-minutes <timeoutMinutes>
string
Maximum number of minutes to run tests before stopping. When the timeout is reached, tests will stop and current results will be printed.
--labels <labels...>
array
Run only tests that match the specified labels.
--output-dir <outputDir>
string
Directory to store run artifacts (screenshots, logs, results). Defaults to the project’s outputDir or ./test-results. The directory is cleared at the start of a run.
--upload-results
boolean
Automatically upload test results to Momentic dashboard after the run. Equivalent to running momentic-mobile results upload <outputDir> after completion.
--reporter <reporter>
string
Reporter to use for the output. One of junit or buildkite-json.
--reporter-dir <reporterDir>
string
Directory where reporter output will be saved. Defaults to ./reports.Reporter filenames are based on the run name. For example, junit writes {name}.xml and buildkite-json writes {name}.buildkite.json. The name comes from --name when provided; otherwise, the detected project’s name is used. For buildkite-json, scope comes from the run name and name comes from the individual test name.
--shard-index <shardIndex>
string
Index of the shard to run (1-indexed). Used with --shard-count to split tests across multiple machines or processes. Defaults to 1. Must be less than or equal to --shard-count.
--shard-count <shardCount>
string
Total number of shards to split the selected tests into. Defaults to 1 (no sharding).
--include <includePatterns...>
array
Only include tests whose file path matches any of the provided regex patterns. The pattern only needs to match part of the path.
--exclude <excludePatterns...>
array
The opposite of --include: tests whose file path matches any of the provided regex patterns are excluded.
--log-level <logLevel>
string
Set logging verbosity. One of error, warn, info, or debug.
--local-avd-id <id>
string
Force tests to use a specific local Android Virtual Device (AVD). Overrides all other configuration at the test and environment level.
--local-apk-path <path>
string
When used together with --local-avd-id, override the APK installed on emulator initialization. Takes precedence over all other configuration at the test and environment level.
--local-ios-device-type <deviceType>
string
Force tests to use a specific local iOS simulator device type. Any option supported by Xcode when creating a new simulator is allowed (e.g., "iPhone 17"). Overrides all other configuration at the test and environment level.
--local-app-path <path>
string
When used together with --local-ios-device-type, override the app installed on simulator initialization. Takes precedence over all other configuration at the test and environment level.