fx - Fuchsia development commands

fx is the entry-point for a set of subcommands that make many tasks related to Fuchsia development easier.

It contains a large number of subcommands. Run fx help to see all the available subcommands. If you use bash or zsh as a shell, source scripts/fx-env.sh
to get some auto-completion.

Also see the global options and flags that affect all subcommands.

fx subcommands

Main subcommands

Subcommands that are part of the fx workflow.

Command Category Description
add-update-source Software delivery register dev host as target's update source
aemu Device management DEPRECATED! deprecated: alias for fx emu
args Build manually edit args.gn for the current build directory
build Build Run Ninja to build Fuchsia
build-push Software delivery build Fuchsia and push to device
cipd Source tree run the cipd command line tool
clean Build clean the current Fuchsia and Zircon build artifacts
clean-build Build clean the build directory and then perform a full build
cp Device management copy a file to/from a target device
doctor Source tree DEPRECATED! run various checks to determine the health of a Fuchsia checkout
emu Run, inspect and debug start fuchsia in an emulator
exec Other read the current build config, then exec
fdt Run, inspect and debug run fuchsia devtools
flash Device management flash and, optionally, pave a connected device
gen Build run gn gen against the Zircon and Fuchsia build directories.
get-build-dir Build print the current fuchsia build directory
get-device Device discovery print the current selected device name
get-device-addr Device discovery print the Fuchsia IPv6 address of the current selected device
gn Build meta-build system that generates build files for Ninja
helpdoc Documentation create markdown docs for fx subcommands
jiri Source tree multi-purpose tool for multi-repo development.
klog Run, inspect and debug listen for kernel logs
list-boards Build list boards available for building
list-packages Build list packages are built
list-products Build list products available for building
list-usb-disks Other list attached usb disks
log Run, inspect and debug listen for logs from the on-device log_listener
metrics Other manage collection of metrics in fx tools
mkzedboot Software delivery make a zedboot USB key
multi Other Run an fx command across multiple build directories.
netaddr Device discovery get the address of a running fuchsia system
netboot Software delivery run bootserver for netbooting
netls Device discovery list running fuchsia systems on the local network
ninja Build directly run the build system. Don't use for regular workflows.
ninjatrace2json Build Collect Ninja trace information for analysis in chrome://tracing
ota Software delivery perform a system OTA on a connected device
pave Software delivery run bootserver for paving
pave-zedboot Software delivery run bootserver for paving zedboot
push-package Software delivery push packages to a device
qemu Run, inspect and debug start fuchsia in qemu with a FVM disk
reboot Device management reboot a target fuchsia system
run Run, inspect and debug DEPRECATED! deprecated: use fx emu / fx qemu instead
run-host-tests Run, inspect and debug build and run tests on host
run-netboot Run, inspect and debug start fuchsia in qemu via netboot
run-test Run, inspect and debug build a test package and run on target.
run-test-component Run, inspect and debug DEPRECATED! build a test package and run on target.
scp Device management invoke scp with the build ssh config
self-test Other run tests of fx and subcommands
serial Device management attach to a serial console
serve Software delivery start pave and serve-updates in a single command
serve-updates Software delivery start the update server and attach to a running fuchsia device
set Build set up a build directory
set-build-dir Build set the default build directory used by other fx commands
set-device Device discovery set the default device to interact with
setup-macos Other register Zircon tools at MacOS Application Firewall
setup-ufw Other setup Linux firewall rules to allow Fuchsia device and emulator traffic.
sftp Device management invoke sftp with the build ssh config
shell Device management start a remote interactive shell in the target device
ssh Device management invoke ssh with the keys from $FUCHSIA_BUILD_DIR/ssh-keys
status Other print relevant information about the developer setup
symbolize Run, inspect and debug symbolize backtraces and program locations provided as input on stdin
syslog Run, inspect and debug DEPRECATED! [deprecated] alias for fx log
test Run, inspect and debug [EXPERIMENTAL] Entry point for all Fuchsia tests (host and target)
traceutil Run, inspect and debug Fuchsia tracing utility
unset-device Device discovery unset the default device to interact with
update Software delivery perform a full update of a target system
use Build re-use a previous build directory set up by fx set
vendor Other forward commands to vendor/*/scripts/devshell
wait Device management wait for a shell to become available
zxdb Run, inspect and debug Fuchsia native debugger

Contrib subcommands

Subcommands that have been contributed by project members that have other levels of support, ownership, or both. The OWNERS file in the contrib directory provides a pointer to the member that supports each script.

Command Category Description
bindc Run, inspect and debug run the bind program compiler and debugger
blobstats Run, inspect and debug compute some blobfs statistics from the build
bt-snoop-from-bugreport Other extract a snoop log from a bugreport as pcap formatted data
bugreport Run, inspect and debug Obtain and parse a bugreport from a connected target.
check-deps Build checks dependency graph in areas
clang-tidy Source tree runs clang-tidy on specified files
compdb Build generate a compilation database for the current build configuration
component-graph Run, inspect and debug start component graph server to map component topology
component-surveyor Other produce a dump of v1 components in CSV form.
dart-remote-test Run, inspect and debug runs a single remote test target through //scripts/run-dart-action.py
dart-tunnel Run, inspect and debug forward local ports to Dart VMs on the device.
debug Run, inspect and debug run the debug agent on target and connect to it with zxdb
delta Software delivery compare all built Fuchsia packages with a prior package snapshot
exec-host-tests Other
extract-zbi Other
fidlcat Run, inspect and debug run fidlcat on given target.
fidldoc Documentation generate documentation for FIDL
fidltags Other generate tags for .fidl files
flutter-attach Run, inspect and debug attach to a running flutter module to enable hot reload and debugging
format-code Source tree runs source formatters on modified files
fuzz Run, inspect and debug run a fuzz test on target a device
gce Other Google Compute Engine commands
gen-cargo Other Runs a Rust helper script inside the fx environment
gen-cargo Source tree generate symlinks to Rust Cargo.toml output files
init-partition-tables Other run bootserver for initializing partition tables
iquery Run, inspect and debug generate a report with component exposed data
lint Source tree runs source linters on modified files
make-fuchsia-vol Other build a fuchsia persistent disk
make-integration-patch Source tree Creates an integration CL to test other CLs in the global integration commit queue.
overnet Run, inspect and debug start an overnet host-pipe to target device
pending-commits Source tree view commits not yet published to global integration
qemu-cipd-ensure Other Generate CIPD files to download the current QEMU package.
roll-compiler Other
run-dart-action Run, inspect and debug Run Dart actions (analysis, test, target-test)
run-e2e-tests Run, inspect and debug run e2e tests
run-recovery Run, inspect and debug start Fuchsia System Recovery in qemu
rustdoc Other Runs a Rust helper script inside the fx environment
rustdoc Documentation generate documentation for Rust code
rustfmt Other Runs a Rust helper script inside the fx environment
rustfmt Source tree format Rust code
save-package-stats Software delivery take a snapshot of all built Fuchsia packages
screenshot Device management takes a screenshot and copies it to the host
set-clock Device management set the clock on target using host clock
set-petal Source tree configure jiri to manage a specific petal
set-relay Other Actuates the state of an external relay by writing a single byte to |tty|.
setup-usb-ethernet Other Setup udev rules for USB CDC ethernet
sniff Run, inspect and debug packet capture and display tool
triage Run, inspect and debug generate a report of error conditions
update-rustc-crate-map Other Runs a Rust helper script inside the fx environment
update-rustc-crate-map Source tree record mapping from Rust package name to crate name and crate type
update-rustc-third-party Source tree updates rustc_library and rustc_binary third_party dependencies
verify-build-packages Build verify the structure of the build package directory in a layer
wipe-partition-tables Other run bootserver for wiping partition tables
zedmon Other run zedmon client