Access launch arguments and command-line parameters in React Native iOS and Android apps. This package is a rewrite of this: https://github.com/iamolegga/react-native-launch-arguments all credits to the original author.
npm install @adeptus_artifex/react-native-launch-arguments
cd ios && pod install # iOS onlyimport { LaunchArguments } from '@adeptus_artifex/react-native-launch-arguments';
const args = LaunchArguments.value();
console.log('Launch args:', args);Launch your app with arguments:
# iOS
xcrun simctl launch booted com.yourapp --env=staging --debug
# Android
adb shell am start -n com.yourapp/.MainActivity --es env staging --ez debug true
Your app receives:
```js
{
env: "staging",
debug: "true"
}--flag→{flag: true}--flag=value→{flag: "value"}--flag value→{flag: "value"}-flag value→{flag: "value"}bareword→{bareword: true}
- Environment switching (dev/staging/prod)
- Feature toggles and debug mode
- Testing automation with Maestro
- Runtime configuration
See CONTRIBUTING.md for details.
MIT