There are two ways to attach a debugger to example components:
From the command-line interface (CLI). This is currently the most well-supported way.
The Fuchsia debugger is called
zxdb. Once attached, you can follow this reference for common
Connect the debugger to your Fuchsia device, for example the emulator started before running an example.
$FUCHSIA_EMBEDDER_DIR/tools/ffx debug connect
When successful, this should start a
[zxdb] prompt, attach to
embedder.cm and add a breakpoint to
[zxdb] attach embedder.cm [zxdb] break main
In a separate terminal, run an example component. The debugger should detect the running component, attach to it and break on the
Install the Fuchsia VSCode extension.
Set the “Ffx Path” setting for this extension to the output from this command:
Make sure the target for the Fuchsia extension is set to
The examples can be run from VSCode's
Run and Debug menu. Breakpoints that are added to the code should be triggered.
There are several options:
Example name: Which of the example components to run. Defaults to
With Flutter Engine: Builds using a custom Flutter Engine (requires setup from
making_engine_changes.md). Default is off.
With Fuchsia: Builds using a custom Fuchsia SDK and platform (requires setup from
testing_fuchsia_sdk_changes.md). Default is off.