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.

CommandCategoryDescription
add-update-sourceSoftware deliveryregister dev host as target's update source
argsBuildmanually edit args.gn for the current build directory
bazelBuildRun experimental Bazel build for Fuchsia platform tree
bootfs-size-reportRun, inspect and debugproduce an uncompressed size report from a ZBI
buildBuildRun Ninja to build Fuchsia
build-metricsOthermanage build metrics configuration
build-pushSoftware deliveryDEPRECATED! build Fuchsia and push to device
cipdSource treerun the cipd command line tool
cleanBuildclean the current Fuchsia build artifacts
clean-buildBuildClean the build directory and then perform a full build
cleandeadBuildDelete stale generated files in the build output directory.
cleandead-buildBuildDelete stale generated files and then perform a full build.
cmcBuildComponent manifest compiler
cpDevice managementcopy a file to/from a target device
createSource treeScaffold new projects
doc-checkerCode submission and reviewCheck the markdown documentation using a variety of checks.
execOtherread the current build config, then exec
fargoBuildFargo is a prototype Fuchsia-specific wrapper around Cargo
fetch-build-artifactsBuildTODO(fxbug.dev/60881): under construction.
flashDevice managementflash and, optionally, pave a connected device
flash-remoteOtherRemotely build, fetch and flash
genBuildrun gn gen against the Fuchsia build directories.
get-build-artifactsInternal apiDEPRECATED! Renamed to list-build-artifacts
get-build-dirBuildprint the current fuchsia build directory
get-deviceDevice discoveryprint the current selected device name
get-device-addrDevice discoveryprint the Fuchsia address of the current selected device
get-flash-sourceInternal apiBuilds and returns a list of a desired set of build artifacts
get-src-dirBuildprint the Fuchsia source directory (checkout root, aka “//”)
get-workspace-dirBuildprint the Bazel workspace directory
gnBuildmeta-build system that generates build files for Ninja
goBuildManage Go source code
goma_authBuildset up authentication for the Goma distributed compilation client
goma_ctlBuildcontrol the local Goma distributed compilation client
helpdocDocumentationcreate markdown docs for fx subcommands
host-toolRun, inspect and debugrun a host tool produced by the build
is-package-server-runningSoftware deliverycheck if the package server is running
jiriSource treemulti-purpose tool for multi-repo development.
jqOtherjq is a utility for manipulating JSON on the command-line.
jq5BuildExtends the functionality of jq to json5 objects.
klogRun, inspect and debuglisten for kernel logs
list-boardsBuildlist boards available for building
list-build-artifactsInternal apiBuilds and returns a list of a desired set of build artifacts
list-devicesDevice discoverylist all nearby devices (excluding those on zedboot)
list-packagesBuildlist packages are built
list-productsBuildlist products available for building
list-usb-disksOtherlist attached usb disks
logRun, inspect and debuglisten for logs from the on-device log_listener
mdlintCode submission and reviewMarkdown linter
merge-package-configOther
metricsOthermanage collection of metrics in fx tools
mkzedbootSoftware deliverymake a zedboot USB key
mkzedboot-remoteSoftware deliverymake a zedboot USB key
multiOtherRun an fx command across multiple build directories.
netaddrDevice discoveryget the address of a running fuchsia system
netbootSoftware deliveryrun bootserver for netbooting
netboot-remoteOtherRemotely build, fetch and netboot
netlsDevice discoverylist running fuchsia systems on the local network
ninjaBuilddirectly run the build system. Don't use for regular workflows.
ninjatrace2jsonBuildCollect Ninja trace information for analysis in chrome://tracing
node-namesDevice managementfind other names for the same node
otaSoftware deliveryperform a system OTA on a connected device
paveSoftware deliveryrun bootserver for paving
pave-remoteOtherRemotely build, fetch and pave
pave-zedbootSoftware deliveryrun bootserver for paving zedboot
pave-zedboot-remoteOtherRemotely build, fetch and pave zedboot
push-packageSoftware deliveryDEPRECATED! push packages to a device
qemuRun, inspect and debugstart fuchsia in qemu with a FVM disk
rebootDevice managementreboot a target fuchsia system
report-bugSoftware delivery
reproBuildLocally replicate the result of infra builds and tests
rfcSource treeScaffold new RFCs
run-host-testsTestDEPRECATED! build and run tests on host
run-in-build-dirBuildRun the given command at the root of the current build directory
run-netbootRun, inspect and debugstart fuchsia in qemu via netboot
scpDevice managementinvoke scp with the build ssh config
self-buildBuildbuild the minimal host dependencies to run fx main workflows
self-testTestrun tests of fx and subcommands
serialDevice managementattach to a serial console
serveSoftware deliverystart the update server and attach to a running fuchsia device
serve-remoteOtherserve from a remote workstation
serve-updatesSoftware deliverystart the update server and attach to a running fuchsia device
setBuildset up a build directory
set-build-dirBuildset the default build directory used by other fx commands
set-deviceDevice discoveryset the default device to interact with
setup-macosOtherregister host tools at MacOS Application Firewall
setup-ufwOthersetup Linux firewall rules to allow Fuchsia device and emulator traffic.
sftpDevice managementinvoke sftp with the build ssh config
shellDevice managementstart a remote interactive shell in the target device
sshDevice managementinvoke ssh with the keys from $FUCHSIA_BUILD_DIR/ssh-keys
statusOtherprint relevant information about the developer setup
symbolizeRun, inspect and debugDeprecated, please use “ffx debug symbolize”
sync-toSource treeSync the local Fuchsia source tree to a given state
syslogRun, inspect and debugDEPRECATED! [deprecated] alias for fx log
testTestEntry point for all Fuchsia tests (host, target and end-to-end)
testgenTestComponent integration test auto-generator
unset-deviceDevice discoveryunset the default device to interact with
updateSoftware deliveryDEPRECATED! [deprecated] alias for fx ota
update-if-in-baseSoftware deliverycheck if packages are in base and update the device if needed
useBuildre-use a previous build directory set up by fx set
vendorOtherforward commands to vendor/*/scripts/devshell
waitDevice managementwait 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.

CommandCategoryDescription
arm-esrOtherdecode ARM Exception Syndrome Register values
bindcRun, inspect and debugrun the bind program compiler and debugger
binutilsRun, inspect and debugProvides a shortcut to the prebuilt LLVM binutils tools
bisect-rustcOther
blobstatsRun, inspect and debugcompute some blobfs statistics from the build
bt-snoop-from-snapshotRun, inspect and debugextract a snoop log from a snapshot as pcap formatted data
check-depsBuildchecks dependency graph in areas
check-goldensSource treeChecks all golden file comparisons in the GN build graph.
check-licensesDocumentationanalyze the license state of a given package or directory
clCode submission and reviewOpen in a new browser window the gerrit review URL.
clang-tidySource treeruns clang-tidy on specified files
clippyOtherRuns a Rust helper script inside the fx environment under the lock
clippyDiagnostic
compdbBuildDEPRECATED
core-testsTestrun zircon core-tests
coverageTestRuns test and exports coverage data.
cpu-statsRun, inspect and debuggenerate a report of CPU stats from a snapshot
dart-remote-testTestruns a single remote test target through //scripts/run-dart-action.py
disDiagnosticDumps disassembly for binaries from the build.
exec-host-testsTest
extract-pprofRun, inspect and debugExtract pprof data from inspect.json
extract-zbiOther
ffxOtherexecute ffx - future fx
fidlcatRun, inspect and debugDeprecated, please use “ffx debug fidl”
fidldocDocumentationgenerate documentation for FIDL
fidltagsOthergenerate tags for .fidl files
flash-buckeyeOtherFlash Fuchsia onto a buckeye board that has already been provisioned with
force-ota-from-devhostSoftware deliveryforce an Over The Air system update from devhost (reboots!)
format-codeSource treeruns source formatters on modified files
fuzzRun, inspect and debugDEPRECATED! run a fuzz test on target a device
gcSoftware deliverygarbage collect packages on the target (reboots!)
gceOtherGoogle Compute Engine commands
gdbRun, inspect and debugRun GDB, the GNU DeBugger.
gen-cargoOtherRuns a Rust helper script inside the fx environment
gen-cargoSource treegenerate symlinks to Rust Cargo.toml output files
gerrit-split-clCode submission and reviewSubmits chains of CLs to Gerrit
gerrit-submitCode submission and reviewSubmits chains of CLs to Gerrit
gnuRun, inspect and debugProvides a shortcut to the prebuilt GNU diagnostic tools
gomaBuildmanage Goma distributed compilation client
grepSource treeprint lines in the Fuchsia sources matching the given pattern
init-partition-tablesOtherrun bootserver for initializing partition tables
iqueryOther
is-incremental-publisher-runningSoftware deliverycheck if the incremental publisher is running
lintSource treeruns source linters on modified files
ls-buildidBuildFind binaries among build directories, the checkout, and cloud storage
make-fuchsia-volOtherbuild a fuchsia persistent disk
mkinstallerSoftware deliverymake a Fuchsia installer image
mkinstaller-remoteSoftware deliverymake a Fuchsia installer image from a remote build host
move-docsDocumentationHelper tool to batch move docs from one location to another
overnetRun, inspect and debugstart an overnet host-pipe to target device
pending-commitsSource treeview commits not yet published to global integration
pprofRun, inspect and debugpprof wrapper that gives access to local files in symbol-index
publishSoftware deliverypublish a set of packages
qemu-cipd-ensureOtherGenerate CIPD files to download the current QEMU package.
remove-update-sourceSoftware deliveryderegisters dev host as target's update source
roll-compilerOther
run-boot-testRun, inspect and debugRun a ZBI test
run-boot-test.pyOther
run-dart-actionRun, inspect and debugRun Dart actions (analysis, test, target-test)
run-e2e-testsTestrun e2e tests
run-in-buildRun, inspect and debugRun a command in the build directory
run-recoveryRun, inspect and debugstart Fuchsia System Recovery in qemu
run-zbi-test-remoteRun, inspect and debugRemotely build a ZBI test, fetch and run it
rustdocOtherRuns a Rust helper script inside the fx environment
rustdocDocumentationgenerate documentation for Rust code
rustfmtOtherRuns a Rust helper script inside the fx environment
rustfmtSource treeformat Rust code
scrutinyRun, inspect and debugAn extensible security auditing framework and toolkit for Fuchsia.
set-petalSource treeconfigure jiri to manage a specific petal
set-relayOtherActuates the state of an external relay by writing a single byte to |tty|.
setup-goOtherSet up the checkout for Go development.
setup-usb-ethernetOtherSetup udev rules for USB CDC ethernet
show-packageSoftware deliverylists package contents
shushSource treesilence rust lints with allows or compiler suggested fixes
size-checkOtherConvenience wrapper for running the product size checker.
smoke-testOtherRuns a Python helper script inside the fx environment
smoke-testTestFinds and runs tests affected by the current change.
snapshotRun, inspect and debugObtain and parse a snapshot from a connected target.
sniffRun, inspect and debugFuchsia packet capture and display tool
sniff.pyOther
symbol-indexBuild(deprecated) manipulate the symbol-index file
sync-from-stemSource treesync integration and deps to a state matching fuchsia.git state
test-rustdocTestruns “fx rustdoc” on all rust targets
test-statsTestQuery and calculate test stats.
test-stats.pyTestQuery and calculate test stats.
traceutilRun, inspect and debugFuchsia tracing utility
triageRun, inspect and debuggenerate a report of error conditions
unarchive-packageSoftware deliveryunarchive a Fuchsia package archive in FAR format
update-3p-ownersSource treeupdates OWNERS files for third_party dependencies
update-rust-3p-outdatedSource treeupdates external Rust dependencies with latest from crates.io
update-rustc-third-partySource treeupdates rustc_library and rustc_binary third_party dependencies
validate-sdkBuildAttempt to build a few known SDK-based OOT repos based on a core SDK
wipe-partition-tablesOtherrun bootserver for wiping partition tables
zbi_json_to_d3js.pyOther
zedmonOtherrun zedmon client
zxdbRun, inspect and debugDeprecated, please use “ffx debug connect”