Follow the official guide to properly setup your environment. We highly recommend using nvm instead of brew or aptitude to install nodejs.
Each environment has its env file with the following filename format:
.[environment].env
You must create the following env files corresponding to each environment.
.dev.env
.stage.env
.production.env
Create all the env files in the root with the following vars corresponding to the environment that belongs:
API_BASE_URL=https://XXXXXXX
OTHER_ENV_VARs=XXXXXXXXXX
Set the following variables in ~/.gradle/gradle.properties
MY_PROYECT_RELEASE_STORE_FILE=my_proyect-key.keystore
MY_PROYECT_RELEASE_KEY_ALIAS=my_proyect-key
MY_PROYECT_RELEASE_STORE_PASSWORD=xxxxxxxx
MY_PROYECT_RELEASE_KEY_PASSWORD=xxxxxxxx
Update the file android/app/build.gradle
according to this guide using the variables set in ~/.gradle/gradle.properties
Generate the file my_proyect-key.keystore
using the following command from your terminal and place it in the android/app
folder
$ keytool -genkey -v -keystore my_proyect-key.keystore -alias my_proyect-key -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password: xxxxx
Re-enter new password: xxxxx
What is your first and last name?
[Unknown]: wolox
What is the name of your organizational unit?
[Unknown]: wolox
What is the name of your organization?
[Unknown]: wolox
What is the name of your City or Locality?
[Unknown]: wolox
What is the name of your State or Province?
[Unknown]: wolox
What is the two-letter country code for this unit?
[Unknown]: wx
Is CN=wolox, OU=wolox, O=wolox, L=wolox, ST=wolox, C=wx correct?
[no]: yes
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=wolox, OU=wolox, O=wolox, L=wolox, ST=wolox, C=wx
Enter key password for <my_proyect-key>
(RETURN if same as keystore password): xxxxx
Re-enter new password: xxxxx
[Storing my_proyect-key.keystore]
We use FastLane and few of its plugins to automate many ios tasks:
- Interact with Apple Developer Portal and iTunes Connect.
- Automate code signing (Certificates and provisioning profiles handling. Take a look at match)
- Uploading builds to Testflight (gym)
Make sure you have the latest version of the Xcode command line tools installed:
xcode-select --install
Follow this guide to properly install rvm. This tool will easily allow you to install and change different ruby versions.
Run rvm -v
to check that it was successfully installed.
The last step is installing Fastlane gems:
gem install bundler
bundle install
This proyect supports many Debug
, QA
, Stage
, and Production
environments.
The following enviorments are supported:
- Dev - Scheme:
dev
- Dev - Configuration:
Debug
- QA - Scheme:
qa
- QA - Configurations:
Debug
orQA
- Stage - Scheme:
stage
- Stage - Configurations:
Debug
orStage
- Production - Scheme:
production
- Production - Configurations:
Debug
orProduction
The default configuration is Debug
.
- Dev/QA - Debug:
qaDebug
- Dev/QA - Release:
qaRelease
- Stage - Debug:
stageDebug
- Stage - Release:
stageRelease
- Production - Debug:
productionDebug
- Production - Release:
productionRelease
To run a Android/iOS simulator with determinated environment, just run:
ANDROID
npx react-native run-android --variant=[build variant]
For Example:
npx react-native run-android --variant=qaDebug
or
npx react-native run-android --variant=qaRelease
iOS
npx react-native run-ios --scheme [scheme] [--configuration [configuration]](optional)
For Example:
npx react-native run-ios --scheme qa
(Debug configuration)
or
npx react-native run-ios --scheme dev --configuration Release
Use the the command in the rootpath to generate the APK:
yarn run android:build.[environment]
For example:
yarn run android:build.qa
It will generate the apk file in the path android/app/build/outputs/apk/[environment]/release/app-[environment]-release.apk
Use the following commands inside the Android project folder:
- Install gems with:
bundle install
- Authenticate with Firebase using Firebase-CLI:
firebase login
. If you don't haveFirebase-CLI
installed you can do it with the following command:npm install -g firebase-tools
. - Run:
bundle exec fastlane android distribute_qa
.
There is a lot of fastlane lanes that will help you to make deploys to Firebase App Distribution and Google Play Console too.
Follow the instructions in the Fastlane README to see all available lanes.
Use the following commands inside the iOS project folder:
- We need to create the app in the AppStore first if it isn't already created. You must be use
bundle exec fastlane create_development_app
. The lane depends of environment, you can usebundle exec fastlane create_stage_app
orbundle exec fastlane create_production_app
- Then you must be use
bundle exec fastlane release_qa
also there are other lanes to deploy to differents environments. You can usebundle exec fastlane release_stage
orbundle exec fastlane release_production
Follow the instructions in the Fastlane README that will help you to create apps, certificates, make deploys and more.
There is a lot of fastlane lanes that will help you to create apps, certificates, make deploys and more.
Follow the instructions in the Fastlane README to see all available lanes.