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
buildBuildRun Ninja to build Fuchsia
build-pushSoftware deliveryDEPRECATED! build Fuchsia and push to device
cipdSource treerun the cipd command line tool
cleanBuildclean the current Fuchsia and Zircon 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
emuRun, inspect and debugstart fuchsia in an emulator
emu-remoteOtherRemotely run emulator
execOtherread the current build config, then exec
fargoBuildFargo is a prototype Fuchsia-specific wrapper around Cargo
fdtRun, inspect and debugrun fuchsia devtools
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-src-dirBuildprint the Fuchsia source directory (checkout root, aka “//”)
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.
jq5BuildExtends the functionality of jq to json5 objects.
jqOtherjq is a utility for manipulating JSON on the command-line.
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
memDiagnosticinvoke mem tool on target device
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 deliveryreport a bug for an fx command
reproBuild[EXPERIMENTAL] locally replicate the result of infra builds and tests
runSoftware deliverybuild Fuchsia and push to device
run-host-testsRun, inspect and debugDEPRECATED! build and run tests on host
run-netbootRun, inspect and debugstart fuchsia in qemu via netboot
run-testRun, inspect and debugDEPRECATED! build a test package and run on target.
run-test-componentRun, inspect and debugDEPRECATED! build a test package and run on target.
scpDevice managementinvoke scp with the build ssh config
self-buildBuildbuild the minimal host dependencies to run fx main workflows
self-testOtherrun tests of fx and subcommands
serialDevice managementattach to a serial console
serveSoftware deliverystart pave and serve-updates in a single command
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 debugsymbolize backtraces and program locations provided as input on stdin
syslogRun, inspect and debugDEPRECATED! [deprecated] alias for fx log
testRun, inspect and debugEntry point for all Fuchsia tests (host, target and end-to-end)
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
vdlOther
vendorOtherforward commands to vendor/*/scripts/devshell
waitDevice managementwait for a shell to become available
zxdbRun, inspect and debugFuchsia 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.

CommandCategoryDescription
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-licensesDocumentationanalyze the license state of a given package or directory
clang-tidySource treeruns clang-tidy on specified files
codesizeRun, inspect and debugCode size attribution on binaries from the system image
compdbBuildDEPRECATED
component-graphRun, inspect and debugstart component graph server to map component topology
component-surveyorOtherproduce a dump of v1 components in CSV form.
core-testsRun, inspect and debugrun zircon core-tests
cpu-statsRun, inspect and debuggenerate a report of CPU stats from a snapshot
dart-remote-testRun, inspect and debugruns a single remote test target through //scripts/run-dart-action.py
dart-tunnelRun, inspect and debugforward local ports to Dart VMs on the device.
debugRun, inspect and debugrun the debug agent on target and connect to it with zxdb
deltaSoftware deliverycompare all built Fuchsia packages with a prior package snapshot
disDiagnosticDumps disassembly for binaries from the build.
disk-extract-serial-logRun, inspect and debugExtract disk image from serial logs.
exec-host-testsOther
extract_pprofRun, inspect and debugExtract pprof data from inspect.json
extract-zbiOther
ffxOtherexecute ffx - future fx
fidlcatRun, inspect and debugrun fidlcat on given target.
fidldocDocumentationgenerate documentation for FIDL
fidltagsOthergenerate tags for .fidl files
flutter-attachRun, inspect and debugattach to a running flutter module to enable hot reload and debugging
format-codeSource treeruns source formatters on modified files
fuzzRun, inspect and debugrun a fuzz test on target a device
gcSoftware deliverygarbage collect packages on the target (reboots!)
gceOtherGoogle Compute Engine commands
gen-cargoOtherRuns a Rust helper script inside the fx environment
gen-cargoSource treegenerate symlinks to Rust Cargo.toml output files
gerrit-submitCode submission and reviewSubmits chains of CLs to Gerrit
gomaBuildmanage Goma distributed compilation client
grepSource treeprint lines in the Fuchsia and Zircon sources matching the given pattern
init-partition-tablesOtherrun bootserver for initializing partition tables
iqueryOther
lintSource treeruns source linters on modified files
make-fuchsia-volOtherbuild a fuchsia persistent disk
mkinstallerSoftware deliverymake a Fuchsia installer image
overnetRun, inspect and debugstart an overnet host-pipe to target device
pending-commitsSource treeview commits not yet published to global integration
qemu-cipd-ensureOtherGenerate CIPD files to download the current QEMU package.
regen-goldensSource treeregenerates golden files in the source tree
roll-compilerOther
run-dart-actionRun, inspect and debugRun Dart actions (analysis, test, target-test)
run-e2e-testsRun, inspect and debugrun 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-testRun, inspect and debugRun a ZBI test
run-zbi-test.pyOther
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
save-package-statsSoftware deliverytake a snapshot of all built Fuchsia packages
screenshotDevice managementtakes a screenshot and copies it to the host
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
smoke-testOtherRuns a Python helper script inside the fx environment
smoke-testBuildFinds and runs tests affected by the current change.
snapshotRun, inspect and debugObtain and parse a snapshot from a connected target.
sniffRun, inspect and debugpacket capture and display tool
sniff.pyOther
symbol-indexBuildmanipulate the symbol-index file
sync-from-stemSource treesync integration and deps to a state matching fuchsia.git state
test-statsOtherQuery and calculate test stats.
test-stats.pyOtherQuery 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-rust-3p-ownersSource treeupdates OWNERS files for Rust third_party dependencies
update-rustc-third-partySource treeupdates rustc_library and rustc_binary third_party dependencies
wipe-partition-tablesOtherrun bootserver for wiping partition tables
zedmonOtherrun zedmon client