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 a repository package server as a device's update source
args Build manually edit args.gn for the current build directory
bazel Build Run experimental Bazel build for Fuchsia platform tree
bazel-tool Build Run the bazel-tool script in the Fuchsia Bazel workspace.
bootfs-size-report Run, inspect and debug produce an uncompressed size report from a ZBI
build Build Run Ninja to build Fuchsia
build-metrics Other manage build metrics configuration
build-profile Other manage build profile configuration
cipd Source tree run the cipd command line tool
clean Build clean the current Fuchsia build artifacts
clean-build Build Clean the build directory and then perform a full build
cleandead Build Delete stale generated files in the build output directory.
cleandead-build Build Delete stale generated files and then perform a full build.
cmc Build Component manifest compiler
cp Device management copy a file to/from a target device
create-pb-zip Other Create pb.zip suitable for flashing based on product_bundles.json file.
create Source tree Scaffold new projects
doc-checker Code submission and review Check the markdown documentation using a variety of checks.
exec Other read the current build config, then exec
fargo Build Fargo is a prototype Fuchsia-specific wrapper around Cargo
fetch-build-artifacts Build TODO(https://fxbug.dev/42139110): under construction.
flash Device management flash and, optionally, pave a connected device
flash-remote Other Remotely build, fetch and flash a Fuchsia image onto a device, see https://fuchsia.dev/fuchsia-src/development/sdk/ffx/flash-a-device
format-code Source tree runs source formatters on modified files
gen Build run gn gen against the Fuchsia build directories.
get-build-artifacts Internal api DEPRECATED! Renamed to list-build-artifacts
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 address of the current selected device
get-flash-source Internal api Builds and returns a list of a desired set of build artifacts
get-src-dir Build print the Fuchsia source directory (checkout root, aka "//")
get-workspace-dir Build print the Bazel workspace directory
gn Build meta-build system that generates build files for Ninja
go Build Manage Go source code
helpdoc Documentation create markdown docs for fx subcommands
host-tool Run, inspect and debug run a host tool produced by the build
is-package-server-running Software delivery check if the package server is running
jiri Source tree multi-purpose tool for multi-repo development.
jq Other jq is a utility for manipulating JSON on the command-line.
jq5 Build Extends the functionality of jq to json5 objects.
klog Run, inspect and debug listen for kernel logs
list-boards Build list boards available for building
list-build-artifacts Internal api Builds and returns a list of a desired set of build artifacts
list-devices Device discovery list all nearby devices (excluding those on zedboot)
list-products Build list products available for building
list-usb-disks Other list attached usb disks
local-publish-platform Other Release platform artifacts to local CIPD instances.
log Run, inspect and debug Display logs from a target device.
mdlint Code submission and review Markdown linter
merge-package-config Other
metrics Other manage collection of metrics in fx tools
mkzedboot Software delivery make a zedboot USB key
mkzedboot-remote 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
netboot-remote Other Remotely build, fetch and netboot
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
node-names Device management find other names for the same node
ota Software delivery perform a system OTA on a connected device
pave Software delivery run bootserver for paving
pave-remote Other Remotely build, fetch and pave
pave-zedboot Software delivery run bootserver for paving zedboot
pave-zedboot-remote Other Remotely build, fetch and pave zedboot
qemu Run, inspect and debug start fuchsia in qemu with a FVM disk
rbe Build check remote build configuration
reboot Device management reboot a target fuchsia system
repro Build Locally replicate the result of infra builds and tests
rfc Source tree Scaffold new RFCs
run-host-tests Test DEPRECATED! build and run tests on host
run-in-build-dir Build Run the given command at the root of the current build directory
run-netboot Run, inspect and debug start fuchsia in qemu via netboot
run-script Other Run a custom combination of commands, able to take advantage of fx -i (iterative mode)
scp Device management invoke scp with the build ssh config
sdk-deps Other List the dependencies of a target, and if dependencies are in SDK
self-build Build build the minimal host dependencies to run fx main workflows
self-test Test run tests of fx and subcommands
serial Device management attach to a serial console
serve Software delivery start the update server and attach to a running fuchsia device
serve-remote Other serve from a remote workstation
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 host 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 ssh keys and configuration for Fuchsia devices.
status Other print relevant information about the developer setup
symbolize Run, inspect and debug Deprecated, please use "ffx debug symbolize"
sync-to Source tree Sync the local Fuchsia source tree to a given state
syslog Run, inspect and debug DEPRECATED! deprecated alias for fx log
test Test Entry point for all Fuchsia tests (host, target, and end-to-end)
testgen Test Component integration test auto-generator
unset-device Device discovery unset the default device to interact with
update Software delivery DEPRECATED! deprecated alias for fx ota
update-if-in-base Software delivery check if packages are in base and update the device if needed
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

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
add-host-test Build add a GN label to args.gn and regen
add-test Build add a GN label to args.gn and regen
arm-esr Other decode ARM Exception Syndrome Register values
bazel2gn Source tree Syncs BUILD.gn and BUILD.bazel for targets that are dual-building in both.
bindc Run, inspect and debug run the bind program compiler and debugger
binutils Run, inspect and debug Provides a shortcut to the prebuilt LLVM binutils tools
bisect-rustc Other
blobstats Run, inspect and debug compute some blobfs statistics from the build
bt-snoop-from-snapshot Run, inspect and debug extract a snoop log from a snapshot as pcap formatted data
build-main-pb Build build the current default product bundle
check-deps Build checks dependency graph in areas
check-goldens Source tree Checks all golden file comparisons in the GN build graph.
check-licenses Documentation analyze the license state of a given package or directory
cl Code submission and review Open in a new browser window the gerrit review URL.
clang-tidy Source tree runs clang-tidy on specified files
clippy Other Runs a Rust helper script inside the fx environment under the lock
clippy Diagnostic
compdb Build DEPRECATED
core-tests Test run zircon core-tests
coverage Test Runs test and exports coverage data.
cpu-stats Run, inspect and debug generate a report of CPU stats from a snapshot
dis Diagnostic Dumps disassembly for binaries from the build.
exec-host-tests Test
extract-pprof Run, inspect and debug Extract pprof data from inspect.json
extract-zbi Other
fastboot Device management interact directly with a device's bootloader via the fastboot protocol
ffx Other execute ffx - developer tools for fuchsia devices.
fidlcat Run, inspect and debug Deprecated, please use "ffx debug fidl"
fidldoc Documentation generate documentation for FIDL
fidltags Other generate tags for .fidl files
find-owner Other
flash-kola Other Flash Fuchsia onto a Kola board that has an unmodified bootloader. Install the user's public SSH
force-ota-from-devhost Software delivery force an Over The Air system update from devhost (reboots!)
fuzz Run, inspect and debug DEPRECATED! run a fuzz test on target a device
gc Software delivery garbage collect packages on the target (reboots!)
gce Other Google Compute Engine commands
gdb Run, inspect and debug Run GDB, the GNU DeBugger.
gen-cargo Other Runs a Rust helper script inside the fx environment
gen-cargo Source tree generate symlinks to Rust Cargo.toml output files
gerrit-split-cl Code submission and review Submits chains of CLs to Gerrit
gerrit-submit Code submission and review Submits chains of CLs to Gerrit
get-main-pb Build print the current main product bundle's label
get-main-pb-path Build get the output path to the provided product bundle
gnu Run, inspect and debug Provides a shortcut to the prebuilt GNU diagnostic tools
grep Source tree print lines in the Fuchsia sources matching the given pattern
init-partition-tables Other run bootserver for initializing partition tables
iquery Other
lint Source tree runs source linters on modified files
list-owners Source tree Finds the nearest OWNERS file corresponding to the provided path, or the
list-packages Build List which packages are built.
ls-buildid Build Find binaries among build directories, the checkout, and cloud storage
make-fuchsia-vol Other build a fuchsia persistent disk
mkinstaller Software delivery make a Fuchsia installer image
mkinstaller-remote Software delivery make a Fuchsia installer image from a remote build host
move-docs Documentation Helper tool to batch move docs from one location to another
pending-commits Source tree view commits not yet published to global integration
power-digest Run, inspect and debug Summarize Inspect power events from Power Broker
power-viz Run, inspect and debug Summarize Inspect power events from Power Broker
pprof Run, inspect and debug pprof wrapper that gives access to local files in symbol-index
publish Software delivery publish a set of packages
qemu-cipd-ensure Other Generate CIPD files to download the current QEMU package.
refresh-bazel-compdb Other
refresh-bazel-compdb-bin.py Other
remove-update-source Software delivery unregister a repository package server as a device's update source
roll-compiler Other
run-boot-test Run, inspect and debug Run a ZBI test
run-boot-test.py Other
run-e2e-tests Test run e2e tests
run-in-build Run, inspect and debug Run a command in the build directory
run-recovery Run, inspect and debug start Fuchsia System Recovery in qemu
run-zbi-test-remote Run, inspect and debug Remotely build a ZBI test, fetch and run it
rust-3p-outdated Other Runs a Rust helper script inside the fx environment under the lock
rust-3p-outdated Diagnostic
rustdoc Other Runs a Rust helper script inside the fx environment
rustdoc-link Other Runs a Rust helper script inside the fx environment
rustdoc-link Documentation Link generated documentation for Rust code. Replaces fx rustdoc
rustdoc Documentation generate documentation for Rust code
rustfmt Other Runs a Rust helper script inside the fx environment
rustfmt Source tree format Rust code
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-go Other Set up the checkout for Go development.
setup-usb-ethernet Other Setup udev rules for USB CDC ethernet
show-package Software delivery lists package contents
shush Source tree silence rust lints with allows or compiler suggested fixes
size-check Other Convenience wrapper for running the product size checker.
smoke-test Other Runs a Python helper script inside the fx environment
smoke-test Test Finds and runs tests affected by the current change.
snapshot Run, inspect and debug Obtain and parse a snapshot from a connected target.
sniff Run, inspect and debug Fuchsia packet capture and display tool
sniff.py Other
symbol-index Build (deprecated) manipulate the symbol-index file
sync-from-stem Source tree sync integration and deps to a state matching fuchsia.git state
system-status Device management Get a summary of system status
test-rustdoc Test runs "fx rustdoc" on all rust targets
test-stats Test Query and calculate test stats.
test-stats.py Test Query and calculate test stats.
triage Run, inspect and debug generate a report of error conditions, with Google-specific rules.
unarchive-package Software delivery unarchive a Fuchsia package archive in FAR format
update-3p-owners Source tree updates OWNERS files for third_party dependencies
update-rust-3p-outdated Source tree updates external Rust dependencies with latest from crates.io
update-rustc-third-party Source tree updates rustc_library and rustc_binary third_party dependencies
validate-sdk Build Attempt to build a few known SDK-based OOT repos based on a core SDK
wipe-partition-tables Other run bootserver for wiping partition tables
zbi_json_to_d3js.py Other
zedmon Other run zedmon client
zxdb Run, inspect and debug Deprecated, please use "ffx debug connect"