title: How to build and deploy a react-native app from command line?
body: <p>I'd like to automate the build + deploy of my React-Native app, for example to submit a TestFlight build. </p>
  
  <p>Before submitting the app, I usually do the following:</p>
  
  <ol>
  <li>I run <code>react-native bundle</code></li>
  <li>I switch the build configuration to <code>Release</code> in the schema</li>
  <li>I comment out the code relative to <code>jsCodeLocation</code> in AppDelegate.m</li>
  </ol>
  
  <p>Is 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 <code>fastlane</code>?</p>
  
  <p>So far, I'd just need to automatize the 2nd and the 3rd step.</p>
  
  <p>To change <code>jsCodeLocation</code> I could add a condition, e.g.</p>
  
  <pre><code>#if "&lt;build configuration is release&gt;"
      jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
  #else 
      jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  #end
  </code></pre>
  
  <p>but i don't know how to reach the build configuration setting. </p>