stigi / react-native-launch-arguments

Get launch arguments for testing with Detox and Appium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-launch-arguments

React Native module to get launch arguments. Make passing parameters from testing tool to react native super easy.

Mostly it's made for using

iOS: it takes data from [[NSProcessInfo processInfo] arguments]

Android: it takes data from currentActivity.getIntent().getBundleExtra("launchArgs") for detox and intent.getExtras() for ADB params

Getting started

npm i react-native-launch-arguments
cd ios && pod install && cd ..

Usage

In JS:

import { LaunchArguments } from "react-native-launch-arguments";
LaunchArguments.value();

In TS:

import { LaunchArguments } from "react-native-launch-arguments";
interface MyExpectedArgs {
  authToken?: string;
  skipAuth?: boolean;
}
LaunchArguments.value<MyExpectedArgs>();

Verifying install

To launch the app with arguments, verifying your install, you can:

iPhone simulator

You can use xcrun to boot your app on the simulator.

The following command-line will load your app on the booted iOS simulator. Just replace com.MyAppBundleId with your Bundle Identifier, and the params with your params.

xcrun simctl launch booted com.MyAppBundleId -noParams -param "hello"

About

Get launch arguments for testing with Detox and Appium

License:MIT License


Languages

Language:Java 46.2%Language:C++ 16.2%Language:Objective-C 10.4%Language:Objective-C++ 8.5%Language:JavaScript 8.1%Language:Ruby 4.5%Language:Makefile 3.5%Language:Starlark 1.4%Language:TypeScript 1.3%