I'd like to automate the build + deploy of my React-Native app, for example to submit a TestFlight build.
Before submitting the app, I usually do the following:
react-native bundle
Release
in the schemajsCodeLocation
in AppDelegate.mIs it possible to write a single command from the Terminal for doing those steps, so that I can then deploy it with an automatization tool, e.g. with fastlane
?
So far, I'd just need to automatize the 2nd and the 3rd step.
To change jsCodeLocation
I could add a condition, e.g.
#if "<build configuration is release>"
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#end
but i don't know how to reach the build configuration setting.
I solved rewriting AppDelegate.m
as
#ifdef DEBUG
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
now i can use fastlane to deploy without editing the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With