Developing the Blink Mobile app for the Galoy Backend can be done in a variety of ways but the officially supported method is via Nix Flake at the root of the repository.
Before you start, ensure you have the following installed on your system:
- Nix (set up with Flakes) - Make sure you have flake support turned on
- Direnv - Hooked up to your shell
- Docker - Optional, only if you need the backend locally
Detailed setup process of individual components is documented in our central repository here.
Once Nix and direnv are set up, follow these steps to set up the galoy-mobile project:
-
Clone the Repository: Clone the galoy-mobile repository to your local machine using Git.
git clone [email protected]:GaloyMoney/galoy-mobile.git cd galoy-mobile
-
Allow Direnv to run it's contents:
direnv allow
This would download all of the dependencies needed to work with the Galoy Mobile. This step sets up the NodeJS runtime, Android SDKs and creates the Emulator AVD for you in it's own separate chamber. It also builds Ruby which is needed for some dependencies. If you're on a Mac, it also lets you know if you're on an unsupported XCode version and gives you instructions on how to switch to a supported one.
-
Install Node and Cocoapods(macOS) Dependencies
yarn install
To run the application on Android:
-
Start the Metro Development Server:
- Run
yarn start
in one terminal window. Ifyarn start
fails on the first run, restart the command as it's a known issue.
- Run
-
Start the Emulator:
- Run
make emulator
in one terminal. This starts the Android emulator. You can also BYOE (bring your own emulator) and run it from your Android Studio.
- Run
-
Run the Application:
- In another terminal, run
yarn android
. If you encounter "error Failed to launch emulator," it's expected and won't exit the android build. Our emulator device will still be available to the Android Debug Bridge (adb).
- In another terminal, run
If while running the app on the emulator, yarn start
crashes, then just restart it and rerun the application.
TMUX One Liner
tmux new-session -d -s mySession 'yarn start' \; split-window -h 'sleep 3 && yarn android' \; select-pane -t 0 \; split-window -v 'make emulator' \; attach-session -d -t mySession
To run the application on iOS:
-
Xcode and Simulator Setup:
- Make sure you have Xcode (and preferably on a version that direnv didn't complain to you about). If you don't you can download it using the
xcodes
CLI see step. - Make sure you have an XCode Simulator Runtime. You probably have it if you had XCode installed previously but you can verify it by running
open -a simulator
. If it fails, you probably don't have it and you can download it usingxcodes
as well see step.
- Make sure you have Xcode (and preferably on a version that direnv didn't complain to you about). If you don't you can download it using the
-
Start the Metro Development Server:
- Run
yarn start
in one terminal window.
- Run
-
Run the Application:
- Run
yarn ios
to start the application on iOS.
- Run
TMUX One Liner
tmux new-session -d -s mySession 'yarn start' \; split-window -h 'yarn ios' \; attach-session -d -t mySession
You can download XCode and Simulator blazingly fast and let the CLI do all of the set up for you hassle free. Here are the commands that do it:
xcodes install 15.3 # Or whatever version direnv tells you about
xcodes runtimes install "iOS 17.4" # Or the latest iOS out there
Xcodes install for the first time prompts you for Apple ID and Password. This is because Apple's license for XCode prohibits distribution of XCode from other servers than their own. And downloads from it can only work if you are authenticated. Hence, to use XCode, you need an Apple ID.