-
About
- peer.ai is a Proof of Concept hybrid app being built with React Native on the peerism protocol.
-
Resources
- Waffle board: https://waffle.io/peerism/peer.ai/join
- Trello: https://trello.com/peerism
- Discord: https://discord.me/peerism
-
Technology stack:
- React Native
- React Native CLI
- Homebrew
- Node Version Manager
- Yarn
- Node.js - JavaScript runtime to build JavaScript code.
- Watchman
- Xcode and Xcode Command Line Tools (CLT)
- Android Studio
- Bash (Unix shell) on macOS
-
Install dependencies
- Install Node Version Manager (NVM)
- Install latest stable version of Node.js using NVM (includes NPM), switch to using, and check where installed
nvm install v8.0.0; nvm use v8.0.0; nvm list; which node;
- Update PATH by appending Node Package Manager (NPM) binary to end of Bash Profile config and reset shell environment
echo 'export PATH="/usr/local/share/npm/bin:$PATH"' >> ~/.bash_profile; source ~/.bash_profile
- Install Watchman
brew install watchman; brew upgrade watchman; which watchman
- Install React Native CLI globally and update package.json
cd PeerAI; yarn add global react-native-cli; yarn add react-native
- Install Yarn and NPM dependencies
cd PeerAI; yarn install --verbose; npm install --verbose
-
Simulation
-
iOS
-
Show React Native iOS Emulation Help
react-native run-ios --help
-
Check that you are in the PeerAI app root directory:
cd PeerAI
-
Create/select iOS Simulator Devices within Xcode
open ios/PeerAI.xcodeproj
-
List iOS Simulator Device Types
ios-sim showdevicetypes
-
Run Emulator (within PeerAI root directory) in iOS Simulator.
react-native run-ios
-
Android
-
Install Android Studio
-
Check that you are in the PeerAI app root directory:
cd PeerAI
-
Install Android Target Platforms using Android SDK Manager
android android --help
-
List Available Targets
android list targets
-
Create Android Virtual Device image using a target that had a Tag (i.e.
android create avd -n <name> -t <target> --abi default/x86_64
). Note: Devices stored in~/.android/avd/.android/avd/
android create avd -n "react" -t "android-N" --abi default/x86_64
-
Show list of Android Virtual Devices
android list avd
-
Configure Virtual Device details using Android Virtual Device (AVD) Manager
android avd
-
Open and perform in Terminal Window #2
- Boot of Android Device using configured Platform (i.e.
emulator -avd <name>
)emulator -avd "react"
- Boot of Android Device using configured Platform (i.e.
-
List Devices
react-native run-android --help adb devices
- Sample output:
$ adb devices List of devices attached emulator-5554 device
- Sample output:
-
Delete previous build
rm android/app/build/outputs/apk/app-debug.apk
-
Run React Native app using the Emulator you have already booted up (within PeerAI root directory)
react-native run-android --deviceId "emulator-5554"
-
-
-
Debugging
- Common
- https://facebook.github.io/react-native/docs/debugging.html
- Chrome Browser
open http://localhost:8081/debugger-ui
- iOS
- (CMD + Shift + K) Hardware > Connect Hardware Keyboard
- (CMD + D) In-App Developer Menu
- Android
- (CMD + M) In-App Developer Menu
- Common
-
-
Troubleshooting
-
Remediation Measures
- Kill React Native server on default port of 8081
OR
kill $(lsof -t -i:8081)
sudo lsof -n -i4TCP:8081 | grep LISTEN kill -9 <cma process id>
- Remove iOS and/or Android build directory, then rebuild
cd PeerAI rm -rf ios/build/ rm -rf android/build/
- Kill React Native server on default port of 8081