Issuing the command:
sentry-cli react-native xcode ../node_modules/react-native/packager/react-native-xcode.sh
does not fit my use case because I need to pass an argument to react-native-xcode.sh (the ENTRY_FILE)
I've tried both:
sentry-cli react-native xcode ../[...]/react-native-xcode.sh ./path/to/my/entry/file.js
sentry-cli react-native xcode "../[...]/react-native-xcode.sh ./path/to/my/entry/file.js"
Neither of them is working.
My work around is to manually edit react-native-xcode.sh to hard code ENTRY_FILE, which is quite tedious and I'm prone to forget fixing it after each yarn install
The reason we let you provide a different build script is precisely to support that. So you could do this:
mybuild.shadd these contents:
../node_modules/react-native/packager/react-native-xcode.sh ./path/to/my/entry/file.js
then use sentry-cli react-native-excode mybuild.sh
Does this work for you?
Closing this due to inactivity.
I faced the same issue and tried @mitsuhiko solution and it's working now!! Thanks lot!
previously i can get it work on sentry/cli: 1.29.1 using
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh index.js
but after i upgrade to sentry/cli: 1.31.0, its keep prompting this error
error: Found argument 'index.js' which wasn't expected, or isn't valid in this context
USAGE:
sentry-cli react-native xcode [OPTIONS] [BUILD_SCRIPT] [-- <ARGS>...]
and after tried your method it works!
@mitsuhiko Hi, I am facing the same issue, and I tried your solution, but now xcode returns me the error Permission denied (os error 13) when trying to run the custom shell script 'Bundle react native code and images'. Do you have any idea why ? My custom script 'bundle_code.sh' is located at the root of my project
Thanks for your help !
changing
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh ./index.js
to
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh -- ./index.js
seemed to work for me... at least it built the app...
@mitsuhiko I haven't been able to get this working - details here. Is there a concrete example anywhere of exactly where to put the script and how to reference it?
I'm getting: Permission denied (os error 13)
I ended up removing the Sentry build step, because it isn't designed to work with bitcode, which iOS projects will have on by default.
It seems a bit strange that the default Sentry setup would be incompatible with the majority of iOS installations.
@mitsuhiko I haven't been able to get this working - details here. Is there a concrete example anywhere of exactly where to put the script and how to reference it?
I'm getting:
Permission denied (os error 13)
I was able to make it build with chmod 755 rnbuild.sh
my xCode bundle command
cd $PROJECT_DIR/..
export SENTRY_PROPERTIES=ios/sentry.properties
export NODE_BINARY=node
./node_modules/@sentry/cli/bin/sentry-cli react-native xcode ./ios/rnbuild.sh
Most helpful comment
The reason we let you provide a different build script is precisely to support that. So you could do this:
mybuild.shadd these contents:
then use
sentry-cli react-native-excode mybuild.shDoes this work for you?