Lightning mobile app
September 17, 2019 ยท View on GitHub
Getting started
This project was bootstrapped using Expo CLI as a bare project. You should only need react-native-cli for development not expo-cli. See the React Native CLI Getting Started Guide
Checking build dependencies
Ensure you have all the following dependencies installed for a complete development environment
- node 10 LTS (
brew install node@10) - react-native-cli (
npm install -g react-native-cli) - watchman (
brew install watchman) - go 1.13.x (
brew install go@1.13) - protoc (
brew install protobuf) go get -u -v golang.org/x/tools/go/packages- gomobile (
go get -u golang.org/x/mobile/cmd/gomobile) - falafel (
go get -u github.com/halseth/falafel)
Required for iOS
- Xcode
- cocoapods 1.7.2 (
brew install cocoapods)
Required for Android
Building lnd
Before running the app, we will build mobile binaries for lnd so GRPC calls can be made during runtime. From the lnd project root run:
make clean
gomobile init
Build the binaries for each platform
make ios // only iOS
make android // only Android
make mobile // both iOS + Android
Next clone this project git clone https://github.com/lightninglabs/lightning-app and copy the lnd mobile binaries over to their respective directories:
lnd/mobile/build/ios/Lndmobile.framework->lightning-app/mobile/ios/lightninglnd/mobile/build/android/Lndmobile.aar->lightning-app/mobile/android/Lndmobile
Running the app
Install dependencies
From the /lightning-app project root run
npm install
cd mobile
npm install
cd ios
pod install
cd ..
Start the app in the simulator
npm run ios
npm run android
Debug the app in Xcode or Android Studio
Start the metro development server
npm start
Then just open ios/LightningApp.xcworkspace in Xcode, or open the project in the android directory in Android Studio.
Generating release builds
iOS
- Open
ios/LightningApp.xcworkspacefrom the finder on your mac - From xcode set the active scheme to
Release - Set the build target as
Generic iOS device - Bump the version and build number in the project
- Build the Archive in the menu under
Product -> Archive
Android
- Open Android Studio
- Open the project in the
androiddirectory - Bump the
versionNameandversionCodeunderapp/build.gradle - From the menu
Build -> Clean Project - From the menu
Build -> Generate Signed Bundle / APK