All notes
ReactNativ

Quick Start

Mac+Android

github.io: react native.


brew install node watchman

npm install -g react-native-cli
react-native init projName

Debugging

react-native: debugging.

Access the developer menu:

Reloading JS: Command + R in the iOS Simulator, or press R twice on Android emulators. wcfNote: press these in the simulator, not in the host system.

Debug on Windows

  1. Enable "Debug JS Remotely" on emulator by clicking Ctrl + m.
  2. Open http://localhost:8081/debugger-ui in Chrome.
  3. Add "debugger" in js codes. Ctrl+m and click "Reload".

Log

Use console.log, console.warn etc. SO: how to do logging in RN.


# As of React Native 0.29 you can simply run the following to see logs in the console:
react-native log-ios
react-native log-android

Distribute

Android APK

github.io: signed apk android.



# Build apk. Suppose you have a react.gradle file in android/app.
cd android && ./gradlew assembleRelease
# the generated APK can be found under android/app/build/outputs/apk/app-release.apk

# Before uploading the release build to the Play Store, make sure you test it thoroughly. Install it on the device using:
cd android && ./gradlew installRelease

FAQ

Could not connect to development server

github.com.

Try running npm start from react-native directory.