From 157b5274b75ffb4a338d35272ba2ae49e7054558 Mon Sep 17 00:00:00 2001 From: Corentin Smith Date: Tue, 9 Feb 2016 10:22:27 -0800 Subject: [PATCH] Update debugging docs with YellowBox/RedBox Summary: See https://github.com/facebook/react-native/issues/5271 Closes https://github.com/facebook/react-native/pull/5737 Reviewed By: svcscm Differential Revision: D2917002 Pulled By: mkonicek fb-gh-sync-id: 9c7cb62b3141d8af1b0213c795cf7c3f334eecd6 shipit-source-id: 9c7cb62b3141d8af1b0213c795cf7c3f334eecd6 --- docs/Debugging.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/Debugging.md b/docs/Debugging.md index 6391d516a..3e7793aab 100644 --- a/docs/Debugging.md +++ b/docs/Debugging.md @@ -20,9 +20,19 @@ To access the in-app developer menu: > 1. For iOS open your project in Xcode and select `Product` → `Scheme` → `Edit Scheme...` (or press `⌘ + <`). Next, select `Run` from the menu on the left and change the Build Configuration to `Release`. > 2. For Android, by default, developer menu will be disabled in release builds done by gradle (e.g with gradle `assembleRelease` task). Although this behavior can be customized by passing proper value to `ReactInstanceManager#setUseDeveloperSupport`. +### Android logging +Run `adb logcat *:S ReactNative:V ReactNativeJS:V` in a terminal to see your Android app's logs. + ### Reload Selecting `Reload` (or pressing `⌘ + r` in the iOS simulator) will reload the JavaScript that powers your application. If you have added new resources (such as an image to `Images.xcassets` on iOS or to `res/drawable` folder on Android) or modified any native code (Objective-C/Swift code on iOS or Java/C++ code on Android), you will need to re-build the app for the changes to take effect. +### YellowBox/RedBox +Using `console.warn` will display an on-screen log on a yellow background. Click on this warning to show more information about it full screen and/or dismiss the warning. + +You can use `console.error` to display a full screen error on a red background. + +These boxes only appear when you're running your app in dev mode. + ### Chrome Developer Tools To debug the JavaScript code in Chrome, select `Debug in Chrome` from the developer menu. This will open a new tab at [http://localhost:8081/debugger-ui](http://localhost:8081/debugger-ui).