React Native - Momentic

Documentation Index

Fetch the complete documentation index at: /docs/llms.txt

Use this file to discover all available pages before exploring further.

Momentic tests the native build of a React Native app. The pipeline is: produce an APK (Android) or simulator .app (iOS), upload it to a channel/tag, run momentic-mobile.

Produce a testable build

The Gradle project lives in android/:

cd android && ./gradlew assembleRelease # APK in android/app/build/outputs/apk/release/

For a faster debug build during authoring, ./gradlew assembleDebug works too: debug builds are debuggable=true and need no extra configuration.

Momentic runs simulator builds, not device .ipa files. Build for testing against the simulator SDK:

xcodebuild
-workspace ios/MyApp.xcworkspace
-scheme MyApp
-sdk iphonesimulator
-configuration Debug
-derivedDataPath build
build-for-testing # .app in build/Build/Products/Debug-iphonesimulator/

Use the .xcworkspace (CocoaPods), not .xcodeproj. Simulator builds skip code signing and need no provisioning profile.

Upload and run

Add the CLI as a dev dependency so the lockfile pins the version in CI:

npm install --save-dev momentic-mobile

Then upload and run:

npx momentic-mobile assets upload ./android/app/build/outputs/apk/release/app-release.apk
--channel dev --tag 1.0.0

smoke.test.yaml

fileType: momentic/mobile-test/v2 id: rn-smoke description: Open the app and verify the home screen platform: android labels: [smoke] defaultChannel: dev defaultTag: "1.0.0" steps: - openApp: com.example.myapp - assert: The home screen is visible

npx momentic-mobile run smoke.test.yaml

In the editor, pick the channel/tag and a Momentic Region for a remote emulator or simulator, or Local for a local instance.

React Native pitfalls

In CI

.github/workflows/mobile.yml

name: Mobile tests on: [pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22.12.0 - run: npm install

--channel/--tag on run select the asset this job just uploaded; tests’defaultChannel/defaultTag only apply when the flags are absent. iOS buildsneed a macOS runner (runs-on: macos-latest) and anxcodebuild build-for-testing step before upload.