Skip to content

Installation

Sworup Shakya edited this page Nov 14, 2022 · 14 revisions

Prerequisites

Installation

  • Clone the repo: git clone https://github.com/openmsupply/mobile.git.
  • Setup local node environment as specified in .nvmrc: nvm install && nvm use.
  • Setup Java using sdkman: sdk use java 10.0.2-zulu
  • Install/update app dependencies: yarn install. Note: this process can take some time, be patient!

Running

  • Using Android Studio. Go to Configure > AVD Manager. Run the Android emulator
  • Make sure:
    1. No mSupply Mobile is installed on the device
    2. Previous Bundler Terminal windows are closed!
    3. Java version and NVM version are correctly set.
  • If you are using nvm, have multiple version of node and have a newer version of node installed in your system as the default Node version, running react-native run-android will build in the expected version (v12.20.0 while writing is) but will open a new terminal window for metro. Metro window thus opened would be in the default version of Node.JS in your system, which could be greater than the expected version. The build will hence fail. To tackle this manually start a metro instance and build in a separate terminal.
    • Open a terminal window, navigate to the mobile repo directory and set it to the expected version of node with nvm use.
    • Run yarn start
    • Open another terminal window, navigate to the mobile repo directory and set it to the expected version of node with nvm use.
    • Run react-native run-android or yarn android
  • If you have only one version of Node installed, and it is the expected version of this repo. Or if you have the expected version of this repo set as the default version of Node in your system. Run the command to start mSupply on the Android emulator: react-native run-android or yarn android