Local Setup

This details how to setup your system to begin coding for SAFER

Prerequisites for SAFER for IOS/Android

  • On your system ensure that you have node installed

  • If you are making an Android an android build, ensure that you have the SDK installed and that the ANDROID_HOME environment variable is set

  • clone the Git Repo

git clone https://github.com/M1ha1lM/SAFER-Capstone/
cd SAFER-Capstone

Prerequisites for SAFER WearOS/Android Watches

  • Ensure you are have the latest Android Studio release downloaded
  • clone the Git Repo for the Watch App
git clone https://github.com/Cryptoniac1/SAFER-WearOS/
cd SAFER-WearOS

To build and start working see WearOS below

Creating the build environment for IOS/Android

  1. Edit the .env file within the directory to set the proper environment variables and API keys. The reference for this can be seen in API.
  2. Follow the instructions in either Android or IOS

For Android

Debug Builds

Ensure that the ANDROID_HOME environment variable is set to the android sdk, then run the following commands:

npm install
npx expo prebuild

If you intend to use the WearOS app as well make a keystore in the default ~/.android/debug.keystore. After this copy that keystore to the android/app directory.

cp ~/.android/debug.keystore android/app/

From here you can connect to your device via adb and run:

npx expo run:android

Note: Sometimes these debug builds show a server connection error on first install, simply close and reopen the app on the android device.

Release Builds

Follow all the steps in the debug build section up until running npx expo run:android. From here instead go into the android directory and run gradlew assembleRelease.

cd android/
./gradlew assembleRelease

The release build of the app will be generated in app/build/outputs/apk/release/app-release.apk signed with the key stored in debug.keystore. Simply transfer it to the android device, and install the apk from there.


For IOS

Run the following commands:

npm install
npx expo prebuild

For WearOS

Note: The WearOS app only works in conjunction with the Android App.

  1. Ensure that you have a ~/.android/debug.keystore.
  • This must be the same as the one the android build was built with
  1. Open the repo that was cloned in android studio and press the build icon.
  2. Connect your WearOS watch via adb
  3. From within android studio press run, and it should build and install to WearOS