The Native logs panel shows what the system logs for your app’s process: the unified log on the iOS Simulator, and logcat on Android. Next to your console output, it shows what happened below your JavaScript, such as why a request failed or what UIKit warned about.
Setting up Native logs in the SDK
Using the Native logs panel
Section titled “Using the Native logs panel”Reading entries
Section titled “Reading entries”Each entry shows its Time, with milliseconds, its Level, its Subsystem / tag and its
Message. On iOS the source is the subsystem, such as com.apple.CFNetwork; hover it to see the
category. On Android it is the logcat tag. Newest entries appear at the bottom. The list follows new
output while you’re scrolled to the bottom; scroll up to stop, and use Jump to latest to go
back. Drag a column edge to resize it, or double-click the edge to reset it. Use Copy on a row
to copy its message.
The level comes from the system’s own level:
| iOS | Android | Level |
|---|---|---|
| Default | Verbose, Debug | log |
| Info | Info | info |
| Warn | warn | |
| Error, Fault | Error, Fatal, Assert | error |
React Native’s own copies of your console output (the ReactNativeJS tag on Android and the
com.facebook.react.log subsystem on iOS) aren’t listed, since they’re already in the
Console.
Filtering by level
Section titled “Filtering by level”The levels are listed under Native logs in the sidebar. Click one to show or hide its entries. All four are shown at first, and your choice is saved between sessions.
Showing and hiding sources
Section titled “Showing and hiding sources”The chips under the toolbar list the subsystems and tags seen so far, most frequent first. Click a chip to hide that source’s entries, and click it again to bring them back.
On iOS, the Apple chip shows or hides every com.apple.* subsystem at once. Apple’s subsystems
are hidden at first, but their errors always show, so a failed request or a UIKit error isn’t
missed. Your choices are saved between sessions.
Searching
Section titled “Searching”Type in Filter native logs… to show only the entries that contain the text. It matches the message, the subsystem or tag and the category, ignoring case.
Excluding entries
Section titled “Excluding entries”Use Exclude in the toolbar to hide entries you don’t want to see. Each filter takes text or a
/pattern/flags expression, matched the same way as the search, and an entry matching any of them
is hidden. Switch a filter off to keep it for later, or edit or delete it. These filters are
separate from the Console’s, are saved between sessions, and can also be managed in
Settings > Filters.
While any filter is active, a bar under the toolbar counts the entries it hides. Show everything turns every level back on, empties the search, shows every source, and switches the exclude filters off without deleting them.
Seeing logs in context
Section titled “Seeing logs in context”Show in context on a row opens Logs in context: your app’s console output and its native logs in one list, ordered by time, with the row you opened it from highlighted. The Type column says whether each line is JS or Native.
For example, when a request to a host that doesn’t exist fails, the native side logs the full
error, with its error code and the URL that failed. To see it next to your own error, log the error
with console.error, then:
- Open Native logs and make the request again.
- Type the host name in Filter native logs…. The
com.apple.CFNetworkerror row shows why it failed:A server with the specified hostname could not be found. - Hover that row and use Show in context.
The pane shows the native lines for the request, then your console.error line marked JS just
after them.
The pane lists everything both panels hold, so the level, search and exclude filters don’t apply to it, but sources you’ve hidden stay hidden.
Show in context is on Console rows too, and opens the same pane.
Clearing the log
Section titled “Clearing the log”Clear native logs empties the list in the desktop app. It doesn’t affect your app or the device.
Limits and Troubleshooting
Section titled “Limits and Troubleshooting”- Native logs are only collected while the Native logs panel is open, and the list starts empty each time you open it. Open it before you reproduce a problem.
- The panel keeps the latest 5,000 entries. “N lines skipped” means the app logged faster than the desktop app could keep up, and some lines were dropped.
- On iOS, only simulators are supported, not physical devices. Lines logged before the panel opened aren’t shown, and neither are debug-level lines.
- On Android, emulators and devices listed by
adb devicesare supported. Opening the panel shows the app’s last 500 lines, and the panel picks the app up again after it restarts. - If the panel shows an error instead of logs:
- No booted iOS simulator was found: boot the simulator your app runs on.
- … is not installed on the booted simulator: install and run your app on that simulator.
- No Android device or emulator is connected: start the emulator, or connect and authorise the device.
- Several Android devices match this app: close the emulators you aren’t using.