Welcome back

Opening shared build

Preparing your Mach workspace…

Preparing your secure download…

Documentation
Blog
Open dashboard
Mach Docs

CLI Reference

Every command at your fingertips.
Project Setup
mach login
Add or renew a saved account without removing other logins
mach logout
Remove the selected local login; use an email or --all for other sessions
mach accounts
List saved account names and current, project and default selections
mach switch [email]
Choose a saved account for this project, or the default outside a project
mach init
Create a new Mach project
mach link
Link existing project to Dashboard
mach me
Check the effective account, selection source and session status
Multiple accounts · CLI 2.12.0+
Sign in once per account, then switch without entering passwords again until a session expires. Updating an account keeps your other saved logins. Install the latest CLI to use these commands.
Add accounts and check your identity
npm install -g @radhya/mach@latest
mach login
# Run login again to add your other account
mach login
mach accounts
mach me
In a folder containing mach.config.json, login and switch remember the account for that project folder. Other project folders keep their own preferences, so two terminals can work with different accounts. Outside a project, switch changes the default account. The --global option changes the default without overriding existing project preferences.
Project preference, default and one-command override
mach switch work@example.com
mach switch personal@example.com --global
mach --account personal@example.com me
mach switch --clear-project
mach accounts --json
Selection order: MACH_TOKEN, then --account, then the project preference, then the default account. A missing selected login stops the command instead of selecting a different account. For monorepos, --config or MACH_CONFIG_PATH selects the config directory whose account preference is used. Preferences and tokens are stored on your computer, outside the repository; no account configuration needs to be committed.
Use an app-specific config
mach --config apps/client/mach.config.json switch work@example.com
mach --config apps/client/mach.config.json me
A running command keeps its starting account through API requests, token refresh and retries. Switching in another terminal affects future commands. Builds and submissions still check project permissions before starting, and show the selected account and project. CI and cloud runners continue using MACH_TOKEN; saved accounts do not override it.
Remove saved logins
mach logout
mach logout work@example.com
mach logout --all
# If a token is set in this shell, remove it separately
unset MACH_TOKEN
Logout removes local sessions without cancelling running jobs or changing a running command’s in-memory session. Project preferences remain as a safety guard; log in or switch before using an affected project, or clear its preference explicitly.
Sessions and project preferences live in ~/.mach/accounts.json with owner-only read/write permissions. Passwords are never saved. The token file is not an encrypted vault, so protect your OS account and backups. Existing credentials.json logins remain readable and migrate on the first login, switch, logout or refresh. Account lists and JSON output show names and selection metadata, never tokens.
Build & Ship
mach build
Build locally, via SSH, or in the cloud
mach maestro
Queue managed Maestro tests for a build or APK
mach web test
Run local Playwright web E2E with E2E test history
mach ota
Setup, publish, list, rollback, and promote OTA updates
mach push
Set up SDK wiring, send tests, and inspect push delivery status
mach submit
Upload binary to App Store or Google Play
mach start
Start dev server with profile-based env injection
Security & Config
mach audit
Project health, delivery impact, and security checks
mach config
Show resolved config for a build profile
mach deeplink
Configure and verify Universal Links, Android App Links, and URI schemes
mach credentials
Manage build, service, and push notification credentials
mach credentials:service
Upload App Store Connect or Google Play service credentials
mach env
Set, list, and download managed environment variables
mach version
Show and seed DB-owned native version counters
Infrastructure
mach agent
Manage local Install Hub device discovery
mach device
Register ad-hoc test devices
mach host
Set up legacy AWS S3 + CloudFront hosting
mach web deploy
Deploy static web output to Mach Web Hosting
mach sitemap
Generate sitemap.xml from Expo Router
Mach Web Hosting
Mach Web Hosting is separate from the AWS mach host command. It uploads a finished Expo, React Native Web, or Flutter web build to private Mach storage and serves it through the managed delivery layer with immutable preview URLs plus Production and Staging aliases.
Static web releases
mach web deploy --output dist
mach web deploy --build --profile store-release
mach web deploy --output build/web --alias staging --no-promote
mach web promote d_0123abcd --alias production
mach web rollback --alias production
mach web domain add --domain www.customer.com
Android cloud build architecture
Android cloud builds launch on one-time EC2 Spot instances by default. The API uploads the full build script and secrets to S3, starts a small bootstrap on the builder, and the runner uploads artifacts before reporting final status back to Mach.
On-demand is used only for spot interruption recovery. If AWS interrupts an active spot build, the runner reports `interrupted` with its instance id. The API relaunches that same build once on on-demand capacity, refreshes the presigned artifact URLs, updates the active instance id, and ignores stale callbacks from the old instance.
After artifacts and final status are safe, Android builders terminate. The runner shuts down with terminate behavior, and the API also calls EC2 terminate as a backup cleanup step. Build instances are tagged with `Service=mach-android-build`, `BuildId`, `ProjectId`, `MarketMode`, and `KeepInstance` for AWS audits.
Common Build Flags
iOS production build (cloud)
mach build --platform ios --build-profile production
Android build (local)
mach build --platform android --local --build-profile staging
iOS build via SSH to Mac
mach build --platform ios --ssh-host mac.local --ssh-user builder
Dry run (generate script only)
mach build --platform android --dry-run
Queue Maestro after a build
mach build --platform android --profile staging --maestro --maestro-flows .maestro
Managed Maestro
Add Maestro flows to `.maestro`. When you run `mach maestro --maestro-flows .maestro` from the project repo, Mach uploads that local flow folder for the managed run. If the folder is not available, Mach falls back to the build source snapshot. Emulator runners need x86_64 ABI support; build with `--maestro`, use an e2e/Maestro profile name, or set `android.emulator` to true.
Run against latest matching build
mach maestro --latest --platform android --profile staging --maestro-flows .maestro
Run against a specific build
mach maestro --build-id <buildId> --maestro-flows .maestro --maestro-retries 1
Use build snapshot flows
mach maestro --build-id <buildId> --maestro-use-build-source
Wait in CI until pass/fail
mach maestro --build-id <buildId> --maestro-flows .maestro --maestro-retries 1 --wait --wait-timeout 60
Run locally on connected emulator
mach maestro --local --build-id <buildId> --maestro-flows .maestro --maestro-retries 1
Forward test credentials
mach maestro --platform ios --local --maestro-flows .maestro-authenticated --maestro-env MAESTRO_TEST_EMAIL --maestro-env MAESTRO_TEST_PASSWORD
Use `--maestro-env <name>` when flows need credentials or other runtime values. Local runs forward only variables that exist in the shell or loaded dotenv environment; the startup log should list every forwarded name. Existing projects keep their legacy managed-run behaviour. Save isolated, project-scoped credentials under Secrets → E2E test variables to avoid supplying test passwords from CI.
Central E2E test variables
Choose Secrets → E2E test variables, select an environment, and use Add variable to save test-only values under Global or your profile’s environment. Use the exact variable names from your test files; no Maestro-specific prefix is required. Newly saved variables are used automatically, with no portal profile mapping or enablement form. Managed iOS runners need MACH CLI 2.13.0 or later for private test output handling.
Managed CI run using centrally stored test values
mach maestro --latest --platform ios --profile e2e --wait
Precedence is explicit --maestro-env values, then the selected profile’s environment secrets, then Global E2E secrets. The CLI resolves inheritance and platform-specific environment overrides from mach.config.json; when environment is omitted, it uses the same profile-name scope fallback as builds. Dashboard runs use the environment recorded with the build. Older builds can use their existing legacy mapping or be tested from the linked CLI project. Scoped secrets are never resolved by guessing when context is missing. Requested variable names are checked before runner launch or billing. Automatic attempts keep one encrypted snapshot; a newly queued rerun resolves current values.
Test values are encrypted and isolated from application build variables, mach env pull and environment exports. Developers see resolved names and their environment; only administrators can change values. There is no reveal or export action. Change history records actors, names and times without values. Existing legacy configurations and explicit pauses remain unchanged until an administrator saves variables with the new workflow or chooses Use automatically. Queued and running tests are unchanged.
Updated runners scrub known values and common encodings from streamed logs, errors and textual reports. An incompatible runner cannot retrieve central values. Screenshots and recordings cannot be reliably redacted; authenticated-run evidence requires developer or higher project access and uses expiring file links. Use sample test accounts and avoid logging secrets or placing them in screenshots. Local --local runs continue to use local variables and do not download stored test credentials. No new scheduler or publishing permission is created by this feature.
Local Playwright Web E2E
Run browser E2E tests with Playwright from your Mac, workstation, or existing CI runner. The first run adds @playwright/test through the project's package manager and ensures Chromium is available. Mach records a safe Playwright · Web · Local result in E2E Tests, but never starts a Mach browser runner.
Run the configured web E2E suite
mach web test
Choose a Playwright project or target
mach web test --project chromium --base-url https://staging.example.com
Use Firefox or a pre-provisioned CI image
mach web test --install-browser firefox\nmach web test --no-setup
The initial setup saves Playwright to the project's development dependencies, so commit its lockfile and let the pipeline's ordinary dependency-install step restore it. Mach checks for Chromium on every run, but Playwright only downloads it when its browser cache is empty. Cache `~/.cache/ms-playwright` on short-lived Linux CI workers to avoid repeat downloads. Use `--no-setup` for an image that already has both the dependency and browser.
Cache dependencies and browsers
Cache the package-manager store and ~/.cache/ms-playwright, keyed from the committed lockfile. A changed Playwright version then receives a compatible fresh browser automatically.
Keep the fast path focused
Run --project chromium for pull requests; use a separate scheduled or release job for Firefox and WebKit coverage.
Match workers to runner capacity
Start with --workers 2 on a two-core runner. Increase only when tests remain stable; use --grep or explicit files for focused pull-request checks.
Collect diagnostics only when needed
Keep CI headless and prefer --trace on-first-retry. Avoid --headed, --ui, and --debug in automated pipelines.
Screenshots, videos, traces, reports, test source, environment values, and browser output stay on the local runner. The dashboard stores only the status, timing, chosen configuration name, browser project, and a base URL origin when you provide one. Local runs have no Mach charge.
Install Hub Agent
The local agent exposes device discovery and install endpoints on port 7070. It is local-only, so it can be started, installed, checked, or stopped without Dashboard authentication.
mach agent
mach agent install
mach agent status
mach agent restart
mach agent stop
mach agent uninstall
CI Build URLs
Use `--json-output` in Bitbucket, GitHub Actions, or any CI runner when another step needs the Dashboard build URL. The file contains `buildId`, `status`, `platform`, and `url`.
mach build --platform android --profile production --json-output mach-android-build.json
ANDROID_URL=$(node -pe "require('./mach-android-build.json').url")
Bitbucket Pipeline Setup
Replace EAS commands with Mach commands, install the Mach CLI in each step, and authenticate with `MACH_TOKEN`. Store builds should use `--auto-version`, `android.versionCode: auto`, or `ios.buildNumber: auto` so Google Play and App Store Connect accept upgrades.
npm install -g @radhya/mach@latest
mach build --platform android --profile $MACH_BUILD_PROFILE --auto-version --json-output mach-android-build.json
ANDROID_URL=$(node -pe "require('./mach-android-build.json').url")
mach submit --latest --platform android --profile $MACH_SUBMIT_PROFILE --track ${MACH_ANDROID_TRACK:-internal} --release-status ${MACH_ANDROID_RELEASE_STATUS:-completed}
MACH_TOKEN
Dashboard access token from Settings → Access Tokens. Required in CI.
MACH_BUILD_PROFILE
Build profile from mach.config.json, such as production or staging.
MACH_SUBMIT_PROFILE
Profile used by submit --latest to choose the correct build.
MACH_ANDROID_TRACK
Google Play track for Android submit: internal, alpha, beta, or production.
MACH_ANDROID_RELEASE_STATUS
Google Play release status for Android submit: completed, draft, halted, or inProgress.
SLACK_WEBHOOK_URL / SLACK_MESSAGE_PREFIX
Used by the Bitbucket Slack notify pipe.
Android submit runs directly against the Google Play Developer API from the CI runner. iOS submit queues a Mach submission and runs on the configured macOS runner; runner provider details remain internal and users see the Mach submission URL.
Name access tokens after the automation that uses them, such as `BitbucketPipeline` or `MacMiniRunner`. Build and submission rows use that identity for Created by without storing personal email/name values on the run record.
In Settings → Access Tokens, Edit lets you rename a token, change its project access, or shorten its expiry while keeping the same MACH_TOKEN value. Review and confirm any project access change; select one or more projects, or choose All projects as an exclusive option. Excluded projects will no longer accept the token. Rotate creates a replacement when you need to extend or renew validity. Expired and revoked tokens cannot be edited or reactivated. Revoke always asks for confirmation; Keep token leaves it active.
Submit & Service Credentials
Upload Google Play service key for a package
mach credentials:service --platform android --package-name com.example.app --file ~/Downloads/play-service-account.json
Pick package id from Dashboard records
mach credentials:service --platform android --file ~/Downloads/play-service-account.json
Submit latest production Android build
mach submit --latest --platform android --profile production
Submit latest production iOS build
mach submit --latest --platform ios --profile production
Google Play service keys are package-scoped store automation credentials. They are separate from Android keystores and are required for Google Play submission for the exact package id.
App Store Connect API keys are used for iOS TestFlight submission and submit metadata. Mach stores the key id, issuer id, Apple Developer Team ID, and provider/team metadata so submit commands do not require Apple ID prompts.
Android submit reads `submit.production.android.track` and `submit.production.android.releaseStatus` from config. Valid release statuses are `completed`, `draft`, `halted`, and `inProgress`; the default is `completed`.
Build Flag Reference
--platform
Target platform: ios or android (required).
--build-profile
Build profile from mach.config.json (default: production).
--local
Run build on your local machine instead of cloud.
--ssh-host
Remote macOS host for iOS builds via SSH.
--dry-run
Generate the build script without launching an instance.
--keep-instance
Debug-only Android builder retention. Production API ignores it unless MACH_ALLOW_ANDROID_KEEP_INSTANCE is explicitly enabled server-side.
--verbose
Enable detailed build logging.
--auto-version
Force Mach-managed Android versionCode or iOS buildNumber assignment for the resolved package/bundle.
--json-output
Write CI-friendly build metadata to a JSON file, including the Dashboard URL.
submit --profile
When used with --latest, only considers successful builds from that profile.
submit --release-status
Android Google Play release status: completed, draft, halted, or inProgress.
credentials:service --package-name
Android package id to attach a Google Play service key to. If omitted, Mach shows package ids saved in the Dashboard.
nodeVersion (config)
React Native/Expo only. Set it at the mach.config.json root — e.g. "nodeVersion": "24" — to select Node through nvm before installing dependencies. Flutter uses flutter.sdkVersion instead.
Previous
AI integrations
Next
Security audit