Build & Deploy
Last updated
Last updated
Copyright © 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.
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
The below sections describe the steps for building the android application in Mac and Windows OS.
Configure Node & npm (recommended to use v16.19.0)
Configure Yarn
Configure Gradle & Java
Configure Expo, refer here.
Configure Android SDK, refer here.
Configure environment variables in your ~/.zshrc /
or ~/.bashrc
(depending upon your shell)
Generate debug keystore for building debug build.
Export keystore
Install Git
Use the below link to download git
After installation, run Git as admin.
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.
Install gradle
Use the command below in Git terminal.
To check the installed gradle version.
gradle -V
Install Java JDK, refer here.
Install expo
Install Android SDK, refer here.
Install Node, refer here.
Install nvm
or
update the nvm version
Install adb
Configure ANDROID_HOME and JAVA_HOME in system environment variables
Clone Inji repository.
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 with sdk.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
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 of APPLICATION_THEME
to orange
or purple
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
Go to the root folder of the project in the terminal.
Install all the dependencies using npm install
.
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.
If you encounter the below issue on Windows,
Run npm i expo-modules-autolinking@~1.1.0
and rebuild the app
Path for debug apk in Inji directory android/app/build/outputs/apk/mosip/debug
Creating A Google Cloud Project Refer to this documentation on setting up a Google Cloud Project - https://developers.google.com/workspace/guides/create-project
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.
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.
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
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>"
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.
The below section describes the steps build the iOS application.
Follow the Steps to configure Node & npm, Expo and generate debug keystore
Configure XCode, refer here.
Enable iCloud and create Containers, refer https://developer.apple.com/help/account/manage-identifiers/create-an-icloud-container/
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
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.