{"id":16534519,"url":"https://github.com/iamolegga/react-native-launch-arguments","last_synced_at":"2025-06-27T14:05:32.254Z","repository":{"id":38391363,"uuid":"261274660","full_name":"iamolegga/react-native-launch-arguments","owner":"iamolegga","description":"Get launch arguments for testing with Detox, Appium, and Maestro","archived":false,"fork":false,"pushed_at":"2025-02-22T11:52:45.000Z","size":1385,"stargazers_count":64,"open_issues_count":21,"forks_count":26,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-27T14:03:35.992Z","etag":null,"topics":["appium","detox","maestro","react-native","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamolegga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-04T19:18:35.000Z","updated_at":"2025-06-19T07:37:37.000Z","dependencies_parsed_at":"2024-11-16T19:02:30.682Z","dependency_job_id":"574697c6-bb9c-4ef9-ae88-d218428eafcc","html_url":"https://github.com/iamolegga/react-native-launch-arguments","commit_stats":{"total_commits":32,"total_committers":11,"mean_commits":2.909090909090909,"dds":0.4375,"last_synced_commit":"2d58e39a62980406b375d611a110b021253ba523"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/iamolegga/react-native-launch-arguments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamolegga%2Freact-native-launch-arguments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamolegga%2Freact-native-launch-arguments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamolegga%2Freact-native-launch-arguments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamolegga%2Freact-native-launch-arguments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamolegga","download_url":"https://codeload.github.com/iamolegga/react-native-launch-arguments/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamolegga%2Freact-native-launch-arguments/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262269909,"owners_count":23285160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appium","detox","maestro","react-native","testing"],"created_at":"2024-10-11T18:24:26.742Z","updated_at":"2025-06-27T14:05:32.227Z","avatar_url":"https://github.com/iamolegga.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-launch-arguments\n\nReact Native module to get launch arguments.\n\nMakes passing parameters from testing libraries and debugs tools to\nreact-native super easy.\n\n## Install\n\n```sh\nnpm i react-native-launch-arguments\ncd ios \u0026\u0026 pod install \u0026\u0026 cd ..\n```\n\n## Usage\n\n### In you code\n#### Javascript\n\n```js\nimport { LaunchArguments } from \"react-native-launch-arguments\";\nLaunchArguments.value();\n```\n\n#### Typescript\n\n```ts\nimport { LaunchArguments } from \"react-native-launch-arguments\";\ninterface MyExpectedArgs {\n  authToken?: string;\n  skipAuth?: boolean;\n}\nLaunchArguments.value\u003cMyExpectedArgs\u003e();\n```\n\n### Integrating with End-to-end testing tools and debuggers\n\nThe intended use is with end-to-end tools like Detox.\n\n#### **[Detox](https://github.com/wix/Detox/)**\n\n* See [`device.launchApp({launchArgs:{...}})`](https://wix.github.io/Detox/docs/api/device/#7-launchargsadditional-process-launch-arguments)\n* See [launch arguments guide](https://wix.github.io/Detox/docs/guide/launch-args) for full details.\n\n#### **[Appium](http://appium.io/)**\n\n* [`optionalIntentArguments (Android)` and `processArguments (iOS)`](https://appium.github.io/appium.io/docs/en/writing-running-appium/caps/)\n   ```tsx\n   capabilities: {\n     optionalIntentArguments: `--ez myBool true --es myStr 'string text'`, // Android\n     processArguments: {args : ['-myBool', 'true','-myStr', 'string text']}, // iOS\n   }\n   ```\n\n#### **[Maestro](https://maestro.mobile.dev/)**\n* [`arguments parameter of launchApp command`](https://maestro.mobile.dev/api-reference/commands/launchapp#launch-arguments)\n  ```yaml\n  - launchApp:\n      appId: \"com.example.app\"\n      arguments:\n         foo: \"This is a string\"\n         isFooEnabled: false\n         fooValue: 3.24\n         fooInt: 3\n  ```\n\n#### **XCode**\n* [`XCode Launch Args`](https://developer.apple.com/documentation/xcode/customizing-the-build-schemes-for-a-project#Specify-launch-arguments-and-environment-variables)\n* In XCode add launch arguments on the \"Arguments\" tab in the \"Run\" section of the Scheme editor:\n    * Product -\u003e Scheme -\u003e Edit Scheme... -\u003e Run -\u003e Arguments tab -\u003e Arguments Passed On Launch\n    * Set each arg witha preceding `-`.\n    * For example if you want to set arg `hello` to `\"world\"` to receive a LaunchArgs instance of`{ \"hello\":\"world\" }`, you would enter the following into the entry space for the arg:\n  ```\n  -hello \"world\"\n  ```\n\n## Platform-specific Notes\n\n### iOS\n\nIt takes data from `[[NSProcessInfo processInfo] arguments]`\n\n#### Verifying install on  iPhone simulator\n\nYou can use `xcrun` to boot your app on the simulator.\n\nThe following command-line will load your app on the booted iOS simulator. Just\nreplace `com.MyAppBundleId` with your Bundle Identifier, and the `params` with\nyour params.\n\n```bash\nxcrun simctl launch booted com.MyAppBundleId -noParams -param \"hello\"\n```\n\n### Android\n\nIt takes data from `currentActivity.getIntent().getBundleExtra(\"launchArgs\")` for detox and `intent.getExtras()` for ADB params\n\n#### Caveats on Android\n\n##### React-Native\n\nDue to React Native [issue #37518](https://github.com/facebook/react-native/issues/37518), on Android, the module force-waits for the Android activity to reach the [RESUMED state](https://developer.android.com/guide/components/activities/activity-lifecycle#alc), 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.\n\n##### Expo\n\nThere is [know `expo` bug](https://github.com/expo/expo/issues/31830) with empty passed arguments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamolegga%2Freact-native-launch-arguments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamolegga%2Freact-native-launch-arguments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamolegga%2Freact-native-launch-arguments/lists"}