question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It would be nice to be able to pass parameters to react-native-xcode.sh

See original GitHub issue

Steps to reproduce the behavior

react-native-xcode.sh in the react package allows for the passing of parameters, e.g., path to index.js for ENTRY_FILE.

Expected behavior

Developer should be able to specify parameters.

Actual behavior

No option available.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
thekevinbrowncommented, Mar 14, 2019

Ah, I got what you’re tying to do now.

The best way to do it would be to have a configuration option in package.json, perhaps packageRoot or bundlingRoot or something similar, then have the fix script action apply this for you if it’s there, and output what it currently does if it’s not. That should be a pretty easy PR to create I reckon.

0reactions
synackalcommented, Mar 8, 2019

I do not think either of our suggestions will work:

(1) Modify/Add the node command within the settings option (2) Modify/Add the ENV values within the settings option

The reason why (1) doesn’t work is because that modification doesn’t replace the existing invocation of your react-native-xcode.sh call it just pre-pends whatever you pass into it; fix-script.js:32. I need to pass a parameter into react-native-xcode.sh.

The reason why (2) doesn’t work is that because in react-native-xcode.sh:66-70 if I set the ENTRY_FILE environment variable it will be overwritten.

What I need to have happen (and what I am currently using as a work-around) is in my Xcode build phases I replace your Bundle React Native code and images step with:

export NODE_BINARY=node
../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh ./src/index.js # <= notice this parameter passing

but by doing this I can’t take advantage of having the fix-script being invoked and possibly missing potential additional behavior you may add in the future.

To answer you stated question, my goal is to bundle my JS code and assets from a different path and name than the default in the main script.

Apologies for taking a little while in getting back to you and also if I’ve missed anything outstandingly obvious.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IOS build stack indefinitely on section "Bundle React Native ...
I can build and run the app from XCode, but running from the CI using FastLane it seems to stack on section "Bundle...
Read more >
Integrating React Native with existing Android and iOS ...
Passing parameter, callback to check the ability to communicate between js and native code. Navigate to a new Activity/ViewController from js ...
Read more >
How can I pass a command line argument into a shell script?
I know that shell scripts just run commands as if they were executed in at the command prompt. I'd like to be able...
Read more >
Advanced Setup for React Native
If you want to generate debug symbols for debug builds, you can pass --allow-fetch as a parameter to react-native-xcode in the above mentioned...
Read more >
Use parameters in a custom query - Looker Studio Help
Parameters let you build more responsive, customizable reports. You can pass parameters in a data source back to the underlying query. To use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found