Video: Building for Production
Level 2 React Native
2. Project Setup
3. React Native Debugging Menu
4. Simple Scrolling List & Layout with Flexbox
5. Capturing User Taps
6. Platform Specific Styling
7. Efficient Lists: Rendering Items with FlatList
8. Capture User Input with TextInput
9. Save User Input in State with useState
11. Swipe Gestures for List Items
12. Add and Remove Items from the List
13. Persisting Lists Between Sessions with AsyncStorage
14. Refactor: Custom Hook
15. React Navigation: Stack Navigation
16. React Navigation: Tab Navigation
17. Storing Items in Cart
18. Rendering Groups of Data with Section List
19. iOS App Icon and Splash Screen
20. Android App Icon and Splash Screen
21. Building for Production
Building for Production
First, ensure you've set up an Apple developer account.
To test a production version of your application, in Xcode, go to Product → Scheme → Edit Scheme. Select the "Run" tab and change the "Build Configuration" to "Release". Build the app as you would normally to test the app in production mode. Note: Make sure to switch this back to re-enable live reloading/development tools.
To build for production, in Xcode, select Product → Build and follow the prompts Xcode gives you to upload it to App Store Connect.
Full iOS Docs: https://facebook.github.io/react-native/docs/running-on-device#building-your-app-for-production
First, ensure you've set up a Google Play Developer Account.
Next, you need to sign your application. The key you're about to create is the key to your app once it's published. If you lose this key or forget any of the associated passwords you will not be able to update your app!
To generate they key fun the following command.
Note: You can change
my-key-alias to whatever you want, just make sure to not the name.
Place the resulting .keystore file in the
android/app directory of your project.
Next edit either
android/gradle.properties (note that these files are outside of your project at the root of your machine) and add the following.
MY_APP to something related to the app you're working on (such as the project name). The values should align with those you set when creating the keystore file.
Next, you need to configure the android app to use those values when signing the application with your keystore file. In
android/app/build.gradle add the following:
Make sure to use the variable names that align with what you set previously.
Finally, you can generate the release build:
The final, signed, production build will then exist at
android/app/build/outputs/apk/release/app-release.apk. To test it first uninstall the existing app from your target device and then run
react-native run-android --variant=release.
To publish the app you'll upload the
app-release.apk to the Google Play console.
Full Android Docs: https://facebook.github.io/react-native/docs/signed-apk-android