po
command on the selected view object and outputs to the Xcode console.X
” in the debug navigator’s “Focused” indicator).UIButton
instance is constructed from a background view and a UILabel
instance. When this filter is enabled, you will see only show one view, a UIButton
instance. If the filter is disabled, you also see the additional subviews when rotated in 3D. Using this option removes clutter that isn’t helpful in normal use, but lets you display the full complexity of details when needed.CFBundleIdentifier
property instead of the value of the CFBundleDisplayName
property.awakeFromNib
inside a block that was queued asynchronously. You can see how the historical backtrace was spliced into the display of Thread 6 to show the enqueuing event and complete the backtrace.awakeFromNib
block in the “Graph serial queue” that is executing on thread 6. Each block in the queue, whether executing or pending, can be disclosed (as this one is) to show its backtrace. This view mode allows you to answer questions such as these: leaks --trace <pointer>
to Xcode debugging with a progressive disclosure UI. When debugging apps with large object graphs, this helps you answer the question “what’s holding on to my view controller that’s still allocated?”po
an object in the console enabling you to obtain its statistics in a quick, convenient way.MallocStackLogging=1
) — the stack traces of all malloc
/ free
calls are logged to diskMallocStackLogging=lite
) — the stack traces only for currently allocated blocks and thus has much lower overhead than traditional stack logging.memgraph
) designed to abstract away the architecture-specific aspects of finding malloc blocks in a target process, understanding the runtime metadata versions of the target, and scanning for references. When you summon the Memory Graph Debugger, Xcode reaches out to the debugged device, pauses the target process, and acquires its memory graph file via a service running with the same architecture as your target process. The graph debugger then searches from the roots to identify unreferenced memory (leaks) and indexes the graph to provide the heap navigator, object root analysis (for referenced blocks), and cycle analysis (for unreferenced blocks)..memgraph
files contain most of the information that leaks
, heap
, and vmmap
require, and can be manually acquired from the command line by running the following on the target device:$ leaks --outputGraph=/tmp/ <process>
leaks
, heap
, and vmmap
also support being run against a .memgraph
file in place of their <process> argument, and sysdiagnose
now outputs a .memgraph
file when invoked targeting a single process.GL_MAX_TEXTURE_IMAGE_UNITS
and GL_EXTENSIONS
.⌘D
keyboard shortcut when your app is running in the iOS Simulator, or ⌘M
when running in an Android emulator on Mac OS and Ctrl+M
on Windows and Linux. Alternatively for Android, you can run the command adb shell input keyevent 82
to open the dev menu (82 being the Menu key code).LogBox.ignoreAllLogs()
. This is useful when giving product demos, for example. Additionally, notifications can be hidden on a per-log basis via LogBox.ignoreLogs()
. This is useful when there's a noisy warning that cannot be fixed, like those in a third-party dependency.undefined is not a function
will automatically open a full screen LogBox error with the source of the error. These errors are dismissable and minimizable so that you can see the state of your app when these errors occur, but should always be addressed.Tools → Developer Tools
from the Chrome Menu to open the Developer Tools. You may also access the DevTools using keyboard shortcuts (⌘⌥I
on macOS, Ctrl
Shift
I
on Windows). You may also want to enable Pause On Caught Exceptions for a better debugging experience.REACT_DEBUGGER
environment variable to a command that will start your custom debugger. You can then select 'Debug JS Remotely' from the Developer Menu to start debugging.REACT_DEBUGGER='node /path/to/launchDebugger.js --port 2345 --type ReactNative'
, then the command node /path/to/launchDebugger.js --port 2345 --type ReactNative /path/to/reactNative/app
will be used to start your debugger.Preferences → Advanced → Select 'Show Develop menu in menu bar'
Develop → Simulator → JSContext
react-devtools
package globally:react-devtools
requires react-native
version 0.62 or higher to work properly.react-devtools
from the terminal to launch the standalone DevTools app:react-devtools
as a project dependency. Add the react-devtools
package to your project using npm install --save-dev react-devtools
, then add 'react-devtools': 'react-devtools'
to the scripts
section in your package.json
, and then run npm run react-devtools
from your project folder to open the DevTools.react-devtools
is running, Inspector will enter a collapsed mode, and instead use the DevTools as primary UI. In this mode, clicking on something in the simulator will bring up the relevant components in the DevTools:debuggerWorker.js
. This step is essential.$r
in the Chrome console, letting you inspect its props, state, and instance properties.expo-cli
workflow, see the guide on ejecting to use this API.Debug → Open System Log.
in the iOS Simulator or by running adb logcat *:S ReactNative:V ReactNativeJS:V
in a terminal while an Android app is running on a device or emulator.RCTWebSocketExecutor.m
and change 'localhost' to the IP address of your computer, then select 'Debug JS Remotely' from the Developer Menu.adb
command line tool to setup port forwarding from the device to your computer:adb reverse tcp:8081 tcp:8081