Skip to content

About

No description, website, or topics provided.

Resources

Stars

13 stars

Watchers

1 watching

Forks

Repository files navigation

react-native-detect-maestro

react-native-detect-maestro on npm react-native-detect-maestro downloads react-native-detect-maestro install size CI E2E

Use this library to detect React Native App is running within the context of Maestro. (based on: https://maestro.mobile.dev/advanced/detect-maestro-in-your-app)

  • supports React Native's New Architecture only (use 1.x for the Old Architecture)

Getting started

yarn add react-native-detect-maestro
# or
npm install react-native-detect-maestro

# and then
npx pod-install

Note

Swift Package Manager — React Native 0.87+ can build the iOS side with SPM. Once your app uses React Native's SPM integration, this library's Package.swift is picked up by the autolinker automatically. Apps using CocoaPods keep working through DetectMaestro.podspec, which compiles the same ios/ sources.

⚠️ Note: if you are using React Native 0.72.x you need to add use_modular_headers! in your ios/Podfile .

Usage

import {DetectMaestro} from 'react-native-detect-maestro';

DetectMaestro.isMaestro() // true or false

Maestro 2.x

Maestro 2.x picks a random driver port, so pass the isMaestro launch argument in your flows:

- launchApp:
    arguments:
      isMaestro: true

Maestro 1.x is still detected without the argument (by checking the driver port: 7001 on Android, 22087 on iOS).

Compatible table

Version React Native Architecture
2.x 0.71+ New only
1.x 0.65+ New & Old

License

MIT

About

No description, website, or topics provided.

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages