
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-native-launch-arguments
Advanced tools
React Native module to get launch arguments.
Makes passing parameters from testing libraries and debugs tools to react-native super easy.
npm i react-native-launch-arguments
cd ios && pod install && cd ..
import { LaunchArguments } from "react-native-launch-arguments";
LaunchArguments.value();
import { LaunchArguments } from "react-native-launch-arguments";
interface MyExpectedArgs {
authToken?: string;
skipAuth?: boolean;
}
LaunchArguments.value<MyExpectedArgs>();
The intended use is with end-to-end tools like Detox.
device.launchApp({launchArgs:{...}})
optionalIntentArguments (Android)
and processArguments (iOS)
capabilities: {
optionalIntentArguments: `--ez myBool true --es myStr 'string text'`, // Android
processArguments: {args : ['-myBool', 'true','-myStr', 'string text']}, // iOS
}
arguments parameter of launchApp command
- launchApp:
appId: "com.example.app"
arguments:
foo: "This is a string"
isFooEnabled: false
fooValue: 3.24
fooInt: 3
XCode Launch Args
-
.hello
to "world"
to receive a LaunchArgs instance of{ "hello":"world" }
, you would enter the following into the entry space for the arg:-hello "world"
It takes data from [[NSProcessInfo processInfo] arguments]
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"
It takes data from currentActivity.getIntent().getBundleExtra("launchArgs")
for detox and intent.getExtras()
for ADB params
Due to React Native issue #37518, on Android, the module force-waits for the Android activity to reach the RESUMED state, before moving foward with native-modules initialization completion. While commonly the wait is scarce (the activity is already in the resumed state at this point), until the RN issue is fixed, the module may introduce delays in app loading time in some edge cases.
There is know expo
bug with empty passed arguments.
FAQs
React Native module for getting launch arguments
The npm package react-native-launch-arguments receives a total of 73,506 weekly downloads. As such, react-native-launch-arguments popularity was classified as popular.
We found that react-native-launch-arguments demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.