简体   繁体   中英

Testing React Native App on TestFlight

I have been trying to find documentation on how to properly create a React Native build that does not need to be on a local network and can use carrier network, and can then be deployed for testing onto TestFlight.

I have been able to get stables on TestFlight but can't figure out how to get the App to run outside the local network.

I have tried this with no luck:

Inside the project AppDelegate.m, uncomment the line below the OPTION 2 comment:

 jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 

This causes the app to load from pre-bundled file on disk. Next, with the development server running (started with npm start), you can curl the URL in the comment, adding an extra dev query parameter:

curl http://localhost:8081/index.ios.bundle \\?dev\\=0 -o main.jsbundle'

Any ideas?

Since v0.14 JS and images are automatically packaged into the iOS app using Bundle React Native code and images Xcode build phase.

All you have to do is run the app from XCode and:

  1. Open ios/YourApp/AppDelegate.m
  2. Uncomment the line, jsCodeLocation = [[NSBundle mainBundle] ...

@rahul2001 I think the answer you're looking for is here... http://facebook.github.io/react-native/docs/running-on-device-ios.html#using-offline-bundle

I've not used TestFlight, but I've found Fabric.io (by twitter) to be super easy to use.

Hope that helps.

Your app needs to be listening to an externally available IP (like something on AWS) instead of a local network specific IP.

You'd use the prebundled binary instead of loading the app from the development server. Your own backend would live at the IP mentioned above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM