Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 4.21 KB

dev.md

File metadata and controls

105 lines (67 loc) · 4.21 KB

Development Environment

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.

Prerequisites

Before you start, ensure you have the following installed on your system:

Detailed setup process of individual components is documented in our central repository here.

Project Setup

Once Nix and direnv are set up, follow these steps to set up the galoy-mobile project:

  1. 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
  2. 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.

  3. Install Node and Cocoapods(macOS) Dependencies

    yarn install

Android Development

To run the application on Android:

  1. Start the Metro Development Server:

    • Run yarn start in one terminal window. If yarn start fails on the first run, restart the command as it's a known issue.
  2. 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.
  3. 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).

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

iOS Development (Mac Only)

To run the application on iOS:

  1. 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 using xcodes as well see step.
  2. Start the Metro Development Server:

    • Run yarn start in one terminal window.
  3. Run the Application:

    • Run yarn ios to start the application on iOS.
TMUX One Liner
tmux new-session -d -s mySession 'yarn start' \; split-window -h 'yarn ios' \; attach-session -d -t mySession

Happy Coding 🧑‍💻✨


XCode and Simulator Setup using xcodes

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.