![]() ![]() Make sure to tick a shared checkbox while duplication schemes. We will name our schemes as MyApp.testing and MyApp.production. To duplicate the default scheme go to menu Product -> Scheme -> Edit Scheme -> Duplicate Scheme We will keep the default scheme for our local development environment. Now we will duplicate the default scheme and create two new schemes for production and testing environments. You can find the default scheme in Xcode’s menu bar Product -> Scheme -> MyApp Where MyApp is the name of your scheme. With the help of schemes, we can set different targets to build and a configuration to use when building. We need to have three different Xcode schemes for it. Now we know we have to manage three different environments with the same codebase (different git branches). Import env from 'react-native-config' Then we can use this env variable to access constants stored in. To access it in our react native code we have to first import react-native-config: env files, let’s see how we can access these environment constants inside our code. env.testing Our env file looks like this:ĪPP_NAME= #app name #below information can be found in Appfile gitignore so that you would not accidentally commit the environment files: ![]() Instead, you can create one example environment file with just the constants that would be used in your app. You don’t have to commit these files to your git branch. env.production for the development, testing, and production environments respectively. In our case we were managing three different environments so we have created 3 different env files i.e.env. $ react-native link react-native-config If cocoapods are used in the project then pod has to be installed as well: You can read more about the fastfile on the official docs, here Installing react-native-config Add react-native-config to your project using the below commands: ![]() We will get to the Fastfile in some time. As we have previously selected Automate beta distribution to TestFlight, we already have a beta lane set up. The Fastfile contains all the actions needed to upload the app to TestFlight. The Appfile contains information needed to connect AppStoreConnect, so you may want to read more about the Appfile in the official docs here. Which contains two files, one is Appfile and another one is Fastfile. Once the setup is finished you will see the Fastlane folder inside your ios folder. Then Fastlane will give you some information, you just need to press enter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |