- install nvm:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
nvm install 7.0.0
nvm use 7.0.0
# or you can download and install https://npm.taobao.org/mirrors/node/latest-v7.x/node-v7.0.0.pkgnpm install --registry=https://registry.npm.taobao.org
- nvm use 7.0.0
- export PATH=node_modules/.bin:$PATH
- make sure your Xcode and the commandline tools installed and selected correctly.
react-native run-ios
.- Press
command + control + Z
in Xcode Simulator, chooseDebug JS Remotely
. - goto http://localhost:8081/debugger-ui, press
command + option + J
to open Chrome developer tools. - you can use the traditional
console.log
api and see the log now. - ref: https://facebook.github.io/react-native/docs/debugging.html
brew install android-sdk
export ANDROID_HOME=/usr/local/opt/android-sdk
# in ~/.bashrcexport PATH=$PATH:${ANDROID_HOME}/tools
source /usr/local/etc/bash_completion.d/adb-completion.bash
- use
android sdk
andandoid avd
to install sdk and create avd. android list targets
android create avd -n test-android-6 -t android-23 --abi default/x86_64
emulator -avd test-android-6
- sign key for andoid
- see the config content in ./android/keystores/debug.keystore.properties
keytool -genkey -v -keystore ~/.android/debug.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias androiddebugkey
- input android as key-store-password
cd android && ./gradlew signingReport
cd ..
react-native run-android
.gitignore