-
Notifications
You must be signed in to change notification settings - Fork 27
Installation
Sworup Shakya edited this page Nov 14, 2022
·
14 revisions
- Before continuing, make sure you have installed all the required prerequisites.
- You must have Environment variable(s) setup in your system to use the admin setting panel.
- 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!
- Using Android Studio. Go to Configure > AVD Manager. Run the Android emulator
- Make sure:
- No mSupply Mobile is installed on the device
- Previous Bundler Terminal windows are closed!
- 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
oryarn android
- Open a terminal window, navigate to the mobile repo directory and set it to the expected version of node with
- 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
oryarn android