Skip to content

Development setup

Kasia Szawan edited this page Apr 27, 2018 · 1 revision

Smartwallet app is written in React Native. The development process requires installing appropriate SDK (either for Android or iOS) and using a phone emulator or a mobile phone.

There are two modes of building the app - development and production mode. After wrapping up an issue, you should check if your changes don't break the production build.

Installation

Prerequisites:

After cloning the smartwallet-app repository to a directory on your computer, enter the directory and run the following command:

yarn install

Running on Android

Please set up an Android development environment as described in React Native documentation.

Then:

yarn android
react-native run-android

The first command will start the Haul bundler and serve the build on your device if both are running on the same network. The second command will run and install a debug build on an attached Android device.

Running on iOS

Please set up the XCode development environment according to React Native docs.

Then:

yarn ios
react-native run-ios --device 

The first command will start the Haul bundler and serve the build on your device if both are running on the same network. If remote debugging is enabled, the debugger-ui will also be available here. The second command run and install a debug build on an attached iOS device.

iOS production build

haul bundle --platform ios --bundle-output ios/main.jsbundle --assets-dest ios

Then open ios/smartwallet/AppDelegate.m and switch jsCodeLocation to be production build (comment out the development one).

Testing

Testing uses Jest. The following script enables watch and testing coverage display as well.

yarn test --watch --coverage