Build & Deploy
Repositories
Prerequisite
XCode for iOS development
To perform offline sharing using BLE, we recommend below:
Devices with Bluetooth v4.2 and above
Android v23 and above for Android
Android - Build and Run
The below sections describe the steps for building the android application in Mac and Windows OS.
1a. Installation and Keystore generation on MAC
Step 1:
Configure Node & npm (recommended to use v16.19.0)
Step 2:
Configure Yarn
Step 3:
Configure Gradle & Java
Step 4:
Configure Expo, refer here.
Step 5:
Configure Android SDK, refer here.
Configure environment variables in your ~/.zshrc /
or ~/.bashrc
(depending upon your shell)
Step 6:
Generate debug keystore for building debug build.
Export keystore
1b. Installation and Keystore generation on Windows
Step 1:
Install Git
Use the below link to download git
After installation, run Git as admin.
Step 2:
Install SDKMAN
Use the below command in Git terminal
If you encounter an error while installing sdkman, please install zip on your system using your favourite package manager.
Install zip
SDKMan
requires the installation of the zip utility, which is not included in the default installation of Windows Git Bash.To address this, please visit the website.
Locate zip in the list of available files and download the zip-3.0-bin.zip archive. Extract the zip.exe file from the archive and place it in the bin folder. Location of bin folder
C:\Program Files\Git\usr\bin
.Finally, rerun the
SDKMan
installation script.
Step 3:
Install gradle
Use the command below in Git terminal.
To check the installed gradle version.
gradle -V
Step 4:
Install Java JDK, refer here.
Step 5:
Install expo
Step 6:
Install Android SDK, refer here.
Step 7:
Install Node, refer here.
Step 8:
Install nvm
or
update the nvm version
Step 9:
Install adb
Configure ANDROID_HOME and JAVA_HOME in system environment variables
2. Command to build the application
Step 1:
Clone Inji repository.
Step 2:
Create an
android/local.properties
file with the following data:
Alternatively, you can open the Android folder in the android studio. It will create
local.properties
file withsdk.dir = <location-of-the-android-sdk>
.
Note:
Default path for MacOS:
/Users/<username>/Library/Android/sdk
Default path for Linux:
/home/<username>/Android/Sdk
Default path for Windows:
C:\Users\<username>\AppData\Local\Android\sdk
Step 3:
Inji application currently supports two themes: orange and purple.
The default theme of the app is orange.
To change the theme of the application, go to
.env
file and change the value ofAPPLICATION_THEME
toorange
orpurple
Step 4:
Update mimoto url as https://api.collab.mosip.net here
Update esignet host as https://esignet.collab.mosip.net here
To deploy mimoto in local refer here
Step 5:
Go to the root folder of the project in the terminal.
Install all the dependencies using
npm install
.
Step 6:
Build and run the application on the device:
Run
npm run android:mosip
to build and install the application on the device.Run
npm run android:mosip --reset-cache
to build and install the application if any change is made in the .env file.
3. Troubleshooting
If you encounter the below issue on Windows,
Run
npm i expo-modules-autolinking@~1.1.0
and rebuild the appPath for debug apk in Inji directory
android/app/build/outputs/apk/mosip/debug
4. Setting Up Google API Services and Client ID for Data backup & Restore
Step 1:
Creating A Google Cloud Project Refer to this documentation on setting up a Google Cloud Project - https://developers.google.com/workspace/guides/create-project
Step 2:
Enabling Google Drive APIs Go to - https://console.cloud.google.com/apis/library
Search for Google drive API
and Select Google Drive API from the list.
Then enable the API.
Step 3:
Create Google Consent Screen
Go to - https://console.cloud.google.com/apis/credentials/consent
Create a new Consent Screen with necessary details such as - App Name, User Support Email, App Logo and Developer Info. Once added these details Save and Continue.
Step 4:
Create Oauth Client ID
Go to - https://console.cloud.google.com/apis/credentials
Click on CREATE CREDENTIALS
and choose OAuth client ID
Choose Appliation type as Android
Add in details such as Name, Package Name and SHA- Fingerptint
Note:
SHA-1 should be of the keystore generated for signing the APK
Make sure you have checked
Custom URI Scheme
inAdvanced Settings
The APK signing keystore needs to be unchanged for backup feature to work as the SHA-1 is 1-1 mapped for a client ID created
Step 5:
Set Environment Variable
Once the Client ID has been created copy the client ID and add it as part of .env
file.
GOOGLE_ANDROID_CLIENT_ID="<copied-client-id>"
5. Build for PlayConsole
The Internal testing version of the build can be uploaded to PlayConsole
for testing. PlayConsole allows the creation of internal testers group.
Publishing build manually to PlayConsole
A Google play console developer account is a must to publish builds in PlayConsole.
Set the backend URL and choose a theme (orange | purple) inside the
.env
file.Build the Apk or App bundle.
Login to PlayConsole and create a new release inside Internal testers.
Upload the Apk or App bundle to PlayConsole.
Upload in PlayConsole
Once the build is uploaded and saved you will be able to see the status of the release with version name, code, API level and some more details.
Select the testers group you want to share with. Once saved, you can copy the link and share the same with the testers to test the APK or App bundle.
You are required to manually share the link with the testers as they will not receive any notifications when a new build is uploaded.
Publishing build via Github actions (Automation) to PlayConsole
A Google PlayConsole developer account must be configured to Inji to publish builds via PlayConsole.
Testers must be added to internal testers group in Play console.
To deploy the Android build to PlayConsole, select
Android Custom Build
workflow from github actions.
Choose the branch, backend url, theme and describe about build details.
Click the
Run
workflow button.Once the pipeline has done with building the app (takes around ~25-30min), you need to login to PlayConsole and verify the build version name and code in the internal testers track.
Now, you can share the link to testers.
Note: Only those who are registered in the selected testers group will be able to download the App from Google Play.
iOS - Build and run
The below section describes the steps build the iOS application.
1. Installation and Keystore generation
Step 1:
Follow the Steps to configure Node & npm, Expo and generate debug keystore
Step 2:
Configure XCode, refer here.
Step 3:
Enable iCloud and create Containers, refer https://developer.apple.com/help/account/manage-identifiers/create-an-icloud-container/
2. Build process
Install all the dependencies
Run Metro bundler in the background
Run Inji directly to a connected device Command to run on simulator
Command to run real device
3. Build for TestFlight
The beta version of the build can be uploaded to TestFlight
for testing. TestFlight allows the creation of internal and external testing teams who will be notified once a new build is published.
Publishing build manually to TestFlight
An Apple developer account is a must to publish builds in TestFlight.
Set the backend URL and choose a theme (orange | purple) inside the
.env
file.Archive the build using
xcode
.Upload the archive to Testflight.
First choose Distribute App
.
Upload in TestFlight
Login to TestFlight and check for the build upload status. Once the build is uploaded successfully, add
Groups
to provide access to testers.
All the group members will be notified about the new build. Open TestFlight and install the new version.
Publishing build via Github actions (Automation) to TestFlight
An Apple developer account must be configured to Inji app to publish builds via TestFlight.
Testers must be added to group in TestFlight.
To deploy the iOS build to testflight, select
Inji iOS build
workflow from github actions.
Choose the branch, backend URL, theme, testers group from TestFlight to get the build and describe about build details.
Click the
Run
workflow button.Once the pipeline has done with building the app (takes around ~25-30min), TestFlight notifies corresponding testers associated with the testers group in email about deployed build details.
Last updated