blob: 47f3b3927fbcd0da1e1d311cec0cf05f75ba64e9 [file] [log] [blame] [view]
# 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](fx.md) that affect all subcommands.
# fx subcommands
## Main subcommands
Subcommands that are part of the [fx workflow](/docs/development/build/fx.md).
Command | Category | Description
------- | -------- | -----------
[add-update-source](cmd/add-update-source.md) | [Software delivery](software_delivery/README.md) | register dev host as target's update source
[args](cmd/args.md) | [Build](build/README.md) | manually edit args.gn for the current build directory
[bazel](cmd/bazel.md) | [Build](build/README.md) | Run experimental Bazel build for Fuchsia platform tree
[bazel-tool](cmd/bazel-tool.md) | [Build](build/README.md) | Run the bazel-tool script in the Fuchsia Bazel workspace.
[bootfs-size-report](cmd/bootfs-size-report.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | produce an uncompressed size report from a ZBI
[build](cmd/build.md) | [Build](build/README.md) | Run Ninja to build Fuchsia
[build-metrics](cmd/build-metrics.md) | [Other](other/README.md) | manage build metrics configuration
[cipd](cmd/cipd.md) | [Source tree](source_tree/README.md) | run the cipd command line tool
[clean](cmd/clean.md) | [Build](build/README.md) | clean the current Fuchsia build artifacts
[clean-build](cmd/clean-build.md) | [Build](build/README.md) | Clean the build directory and then perform a full build
[cleandead](cmd/cleandead.md) | [Build](build/README.md) | Delete stale generated files in the build output directory.
[cleandead-build](cmd/cleandead-build.md) | [Build](build/README.md) | Delete stale generated files and then perform a full build.
[cmc](cmd/cmc.md) | [Build](build/README.md) | Component manifest compiler
[cp](cmd/cp.md) | [Device management](device_management/README.md) | copy a file to/from a target device
[create-pb-zip](cmd/create-pb-zip.md) | [Other](other/README.md) | Create pb.zip based on product\_bundles.json file. The created zip file will
[create](cmd/create.md) | [Source tree](source_tree/README.md) | Scaffold new projects
[doc-checker](cmd/doc-checker.md) | [Code submission and review](code_submission_and_review/README.md) | Check the markdown documentation using a variety of checks.
[exec](cmd/exec.md) | [Other](other/README.md) | read the current build config, then exec
[fargo](cmd/fargo.md) | [Build](build/README.md) | Fargo is a prototype Fuchsia-specific wrapper around Cargo
[fetch-build-artifacts](cmd/fetch-build-artifacts.md) | [Build](build/README.md) | TODO(https://fxbug.dev/42139110): under construction.
[flash](cmd/flash.md) | [Device management](device_management/README.md) | flash and, optionally, pave a connected device
[flash-remote](cmd/flash-remote.md) | [Other](other/README.md) | 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](cmd/format-code.md) | [Source tree](source_tree/README.md) | runs source formatters on modified files
[gen](cmd/gen.md) | [Build](build/README.md) | run `gn gen` against the Fuchsia build directories.
[get-build-artifacts](cmd/get-build-artifacts.md) | [Internal api](internal_api/README.md) | DEPRECATED! Renamed to `list-build-artifacts`
[get-build-dir](cmd/get-build-dir.md) | [Build](build/README.md) | print the current fuchsia build directory
[get-device](cmd/get-device.md) | [Device discovery](device_discovery/README.md) | print the current selected device name
[get-device-addr](cmd/get-device-addr.md) | [Device discovery](device_discovery/README.md) | print the Fuchsia address of the current selected device
[get-flash-source](cmd/get-flash-source.md) | [Internal api](internal_api/README.md) | Builds and returns a list of a desired set of build artifacts
[get-src-dir](cmd/get-src-dir.md) | [Build](build/README.md) | print the Fuchsia source directory (checkout root, aka "//")
[get-workspace-dir](cmd/get-workspace-dir.md) | [Build](build/README.md) | print the Bazel workspace directory
[gn](cmd/gn.md) | [Build](build/README.md) | meta-build system that generates build files for Ninja
[go](cmd/go.md) | [Build](build/README.md) | Manage Go source code
[goma_auth](cmd/goma_auth.md) | [Build](build/README.md) | set up authentication for the Goma distributed compilation client
[goma_ctl](cmd/goma_ctl.md) | [Build](build/README.md) | control the local Goma distributed compilation client
[helpdoc](cmd/helpdoc.md) | [Documentation](documentation/README.md) | create markdown docs for fx subcommands
[host-tool](cmd/host-tool.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | run a host tool produced by the build
[is-package-server-running](cmd/is-package-server-running.md) | [Software delivery](software_delivery/README.md) | check if the package server is running
[jiri](cmd/jiri.md) | [Source tree](source_tree/README.md) | multi-purpose tool for multi-repo development.
[jq](cmd/jq.md) | [Other](other/README.md) | jq is a utility for manipulating JSON on the command-line.
[jq5](cmd/jq5.md) | [Build](build/README.md) | Extends the functionality of jq to json5 objects.
[klog](cmd/klog.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | listen for kernel logs
[list-boards](cmd/list-boards.md) | [Build](build/README.md) | list boards available for building
[list-build-artifacts](cmd/list-build-artifacts.md) | [Internal api](internal_api/README.md) | Builds and returns a list of a desired set of build artifacts
[list-devices](cmd/list-devices.md) | [Device discovery](device_discovery/README.md) | list all nearby devices (excluding those on zedboot)
[list-products](cmd/list-products.md) | [Build](build/README.md) | list products available for building
[list-usb-disks](cmd/list-usb-disks.md) | [Other](other/README.md) | list attached usb disks
[log](cmd/log.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | listen for logs from the on-device log\_listener
[mdlint](cmd/mdlint.md) | [Code submission and review](code_submission_and_review/README.md) | Markdown linter
[merge-package-config](cmd/merge-package-config.md) | [Other](other/README.md) |
[metrics](cmd/metrics.md) | [Other](other/README.md) | manage collection of metrics in fx tools
[mkzedboot](cmd/mkzedboot.md) | [Software delivery](software_delivery/README.md) | make a zedboot USB key
[mkzedboot-remote](cmd/mkzedboot-remote.md) | [Software delivery](software_delivery/README.md) | make a zedboot USB key
[multi](cmd/multi.md) | [Other](other/README.md) | Run an `fx` command across multiple build directories.
[netaddr](cmd/netaddr.md) | [Device discovery](device_discovery/README.md) | get the address of a running fuchsia system
[netboot](cmd/netboot.md) | [Software delivery](software_delivery/README.md) | run bootserver for netbooting
[netboot-remote](cmd/netboot-remote.md) | [Other](other/README.md) | Remotely build, fetch and netboot
[netls](cmd/netls.md) | [Device discovery](device_discovery/README.md) | list running fuchsia systems on the local network
[ninja](cmd/ninja.md) | [Build](build/README.md) | directly run the build system. Don't use for regular workflows.
[ninjatrace2json](cmd/ninjatrace2json.md) | [Build](build/README.md) | Collect Ninja trace information for analysis in chrome://tracing
[node-names](cmd/node-names.md) | [Device management](device_management/README.md) | find other names for the same node
[ota](cmd/ota.md) | [Software delivery](software_delivery/README.md) | perform a system OTA on a connected device
[pave](cmd/pave.md) | [Software delivery](software_delivery/README.md) | run bootserver for paving
[pave-remote](cmd/pave-remote.md) | [Other](other/README.md) | Remotely build, fetch and pave
[pave-zedboot](cmd/pave-zedboot.md) | [Software delivery](software_delivery/README.md) | run bootserver for paving zedboot
[pave-zedboot-remote](cmd/pave-zedboot-remote.md) | [Other](other/README.md) | Remotely build, fetch and pave zedboot
[qemu](cmd/qemu.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | start fuchsia in qemu with a FVM disk
[reboot](cmd/reboot.md) | [Device management](device_management/README.md) | reboot a target fuchsia system
[repro](cmd/repro.md) | [Build](build/README.md) | Locally replicate the result of infra builds and tests
[rfc](cmd/rfc.md) | [Source tree](source_tree/README.md) | Scaffold new RFCs
[run-host-tests](cmd/run-host-tests.md) | [Test](test/README.md) | DEPRECATED! build and run tests on host
[run-in-build-dir](cmd/run-in-build-dir.md) | [Build](build/README.md) | Run the given command at the root of the current build directory
[run-netboot](cmd/run-netboot.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | start fuchsia in qemu via netboot
[run-script](cmd/run-script.md) | [Other](other/README.md) | Run a custom combination of commands, able to take advantage of `fx -i` (iterative mode)
[scp](cmd/scp.md) | [Device management](device_management/README.md) | invoke scp with the build ssh config
[sdk-deps](cmd/sdk-deps.md) | [Other](other/README.md) | List the dependencies of a target, and if dependencies are in SDK
[self-build](cmd/self-build.md) | [Build](build/README.md) | build the minimal host dependencies to run fx main workflows
[self-test](cmd/self-test.md) | [Test](test/README.md) | run tests of fx and subcommands
[serial](cmd/serial.md) | [Device management](device_management/README.md) | attach to a serial console
[serve](cmd/serve.md) | [Software delivery](software_delivery/README.md) | start the update server and attach to a running fuchsia device
[serve-remote](cmd/serve-remote.md) | [Other](other/README.md) | serve from a remote workstation
[set](cmd/set.md) | [Build](build/README.md) | set up a build directory
[set-build-dir](cmd/set-build-dir.md) | [Build](build/README.md) | set the default build directory used by other fx commands
[set-device](cmd/set-device.md) | [Device discovery](device_discovery/README.md) | set the default device to interact with
[setup-macos](cmd/setup-macos.md) | [Other](other/README.md) | register host tools at MacOS Application Firewall
[setup-ufw](cmd/setup-ufw.md) | [Other](other/README.md) | setup Linux firewall rules to allow Fuchsia device and emulator traffic.
[sftp](cmd/sftp.md) | [Device management](device_management/README.md) | invoke sftp with the build ssh config
[shell](cmd/shell.md) | [Device management](device_management/README.md) | start a remote interactive shell in the target device
[ssh](cmd/ssh.md) | [Device management](device_management/README.md) | invoke ssh with the keys from $FUCHSIA\_BUILD\_DIR/ssh-keys
[status](cmd/status.md) | [Other](other/README.md) | print relevant information about the developer setup
[symbolize](cmd/symbolize.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Deprecated, please use "ffx debug symbolize"
[sync-to](cmd/sync-to.md) | [Source tree](source_tree/README.md) | Sync the local Fuchsia source tree to a given state
[syslog](cmd/syslog.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | DEPRECATED! [deprecated] alias for fx log
[test](cmd/test.md) | [Test](test/README.md) | Entry point for all Fuchsia tests (host, target and end-to-end)
[testgen](cmd/testgen.md) | [Test](test/README.md) | Component integration test auto-generator
[unset-device](cmd/unset-device.md) | [Device discovery](device_discovery/README.md) | unset the default device to interact with
[update](cmd/update.md) | [Software delivery](software_delivery/README.md) | DEPRECATED! [deprecated] alias for fx ota
[update-if-in-base](cmd/update-if-in-base.md) | [Software delivery](software_delivery/README.md) | check if packages are in base and update the device if needed
[use](cmd/use.md) | [Build](build/README.md) | re-use a previous build directory set up by `fx set`
[vendor](cmd/vendor.md) | [Other](other/README.md) | forward commands to vendor/\*/scripts/devshell
[wait](cmd/wait.md) | [Device management](device_management/README.md) | 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](https://cs.opensource.google/fuchsia/fuchsia/+/main:tools/devshell/contrib/OWNERS) in the
contrib directory provides a pointer to the member that supports each script.
Command | Category | Description
------- | -------- | -----------
[add-test](cmd/add-test.md) | [Build](build/README.md) | add a GN label to args.gn and regen
[arm-esr](cmd/arm-esr.md) | [Other](other/README.md) | decode ARM Exception Syndrome Register values
[bindc](cmd/bindc.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | run the bind program compiler and debugger
[binutils](cmd/binutils.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Provides a shortcut to the prebuilt LLVM binutils tools
[bisect-rustc](cmd/bisect-rustc.md) | [Other](other/README.md) |
[blobstats](cmd/blobstats.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | compute some blobfs statistics from the build
[bt-snoop-from-snapshot](cmd/bt-snoop-from-snapshot.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | extract a snoop log from a snapshot as pcap formatted data
[check-deps](cmd/check-deps.md) | [Build](build/README.md) | checks dependency graph in areas
[check-goldens](cmd/check-goldens.md) | [Source tree](source_tree/README.md) | Checks all golden file comparisons in the GN build graph.
[check-licenses](cmd/check-licenses.md) | [Documentation](documentation/README.md) | analyze the license state of a given package or directory
[cl](cmd/cl.md) | [Code submission and review](code_submission_and_review/README.md) | Open in a new browser window the gerrit review URL.
[clang-tidy](cmd/clang-tidy.md) | [Source tree](source_tree/README.md) | runs clang-tidy on specified files
[clippy](cmd/clippy.md) | [Other](other/README.md) | Runs a Rust helper script inside the fx environment under the lock
[clippy](cmd/clippy.md) | [Diagnostic](diagnostic/README.md) |
[compdb](cmd/compdb.md) | [Build](build/README.md) | DEPRECATED
[core-tests](cmd/core-tests.md) | [Test](test/README.md) | run zircon core-tests
[coverage](cmd/coverage.md) | [Test](test/README.md) | Runs test and exports coverage data.
[cpu-stats](cmd/cpu-stats.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | generate a report of CPU stats from a snapshot
[dis](cmd/dis.md) | [Diagnostic](diagnostic/README.md) | Dumps disassembly for binaries from the build.
[exec-host-tests](cmd/exec-host-tests.md) | [Test](test/README.md) |
[extract-pprof](cmd/extract-pprof.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Extract pprof data from inspect.json
[extract-zbi](cmd/extract-zbi.md) | [Other](other/README.md) |
[fastboot](cmd/fastboot.md) | [Device management](device_management/README.md) | interact directly with a device's bootloader via the fastboot protocol
[ffx](cmd/ffx.md) | [Other](other/README.md) | execute ffx - future fx
[fidlcat](cmd/fidlcat.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Deprecated, please use "ffx debug fidl"
[fidldoc](cmd/fidldoc.md) | [Documentation](documentation/README.md) | generate documentation for FIDL
[fidltags](cmd/fidltags.md) | [Other](other/README.md) | generate tags for .fidl files
[force-ota-from-devhost](cmd/force-ota-from-devhost.md) | [Software delivery](software_delivery/README.md) | force an Over The Air system update from devhost (reboots!)
[fuzz](cmd/fuzz.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | DEPRECATED! run a fuzz test on target a device
[gc](cmd/gc.md) | [Software delivery](software_delivery/README.md) | garbage collect packages on the target (reboots!)
[gce](cmd/gce.md) | [Other](other/README.md) | Google Compute Engine commands
[gdb](cmd/gdb.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Run GDB, the GNU DeBugger.
[gen-cargo](cmd/gen-cargo.md) | [Other](other/README.md) | Runs a Rust helper script inside the fx environment
[gen-cargo](cmd/gen-cargo.md) | [Source tree](source_tree/README.md) | generate symlinks to Rust Cargo.toml output files
[gerrit-split-cl](cmd/gerrit-split-cl.md) | [Code submission and review](code_submission_and_review/README.md) | Submits chains of CLs to Gerrit
[gerrit-submit](cmd/gerrit-submit.md) | [Code submission and review](code_submission_and_review/README.md) | Submits chains of CLs to Gerrit
[gnu](cmd/gnu.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Provides a shortcut to the prebuilt GNU diagnostic tools
[goma](cmd/goma.md) | [Build](build/README.md) | manage Goma distributed compilation client
[grep](cmd/grep.md) | [Source tree](source_tree/README.md) | print lines in the Fuchsia sources matching the given pattern
[init-partition-tables](cmd/init-partition-tables.md) | [Other](other/README.md) | run bootserver for initializing partition tables
[iquery](cmd/iquery.md) | [Other](other/README.md) |
[lint](cmd/lint.md) | [Source tree](source_tree/README.md) | runs source linters on modified files
[list-packages](cmd/list-packages.md) | [Build](build/README.md) | List which packages are built.
[ls-buildid](cmd/ls-buildid.md) | [Build](build/README.md) | Find binaries among build directories, the checkout, and cloud storage
[make-fuchsia-vol](cmd/make-fuchsia-vol.md) | [Other](other/README.md) | build a fuchsia persistent disk
[mkinstaller](cmd/mkinstaller.md) | [Software delivery](software_delivery/README.md) | make a Fuchsia installer image
[mkinstaller-remote](cmd/mkinstaller-remote.md) | [Software delivery](software_delivery/README.md) | make a Fuchsia installer image from a remote build host
[move-docs](cmd/move-docs.md) | [Documentation](documentation/README.md) | Helper tool to batch move docs from one location to another
[pending-commits](cmd/pending-commits.md) | [Source tree](source_tree/README.md) | view commits not yet published to global integration
[pprof](cmd/pprof.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | pprof wrapper that gives access to local files in symbol-index
[publish](cmd/publish.md) | [Software delivery](software_delivery/README.md) | publish a set of packages
[qemu-cipd-ensure](cmd/qemu-cipd-ensure.md) | [Other](other/README.md) | Generate CIPD files to download the current QEMU package.
[refresh-bazel-compdb](cmd/refresh-bazel-compdb.md) | [Other](other/README.md) |
[refresh-bazel-compdb-bin.py](cmd/refresh-bazel-compdb-bin.py.md) | [Other](other/README.md) |
[remove-update-source](cmd/remove-update-source.md) | [Software delivery](software_delivery/README.md) | deregisters dev host as target's update source
[roll-compiler](cmd/roll-compiler.md) | [Other](other/README.md) |
[run-boot-test](cmd/run-boot-test.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Run a ZBI test
[run-boot-test.py](cmd/run-boot-test.py.md) | [Other](other/README.md) |
[run-e2e-tests](cmd/run-e2e-tests.md) | [Test](test/README.md) | run e2e tests
[run-in-build](cmd/run-in-build.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Run a command in the build directory
[run-recovery](cmd/run-recovery.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | start Fuchsia System Recovery in qemu
[run-zbi-test-remote](cmd/run-zbi-test-remote.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Remotely build a ZBI test, fetch and run it
[rust-3p-outdated](cmd/rust-3p-outdated.md) | [Other](other/README.md) | Runs a Rust helper script inside the fx environment under the lock
[rust-3p-outdated](cmd/rust-3p-outdated.md) | [Diagnostic](diagnostic/README.md) |
[rustdoc](cmd/rustdoc.md) | [Other](other/README.md) | Runs a Rust helper script inside the fx environment
[rustdoc](cmd/rustdoc.md) | [Documentation](documentation/README.md) | generate documentation for Rust code
[rustfmt](cmd/rustfmt.md) | [Other](other/README.md) | Runs a Rust helper script inside the fx environment
[rustfmt](cmd/rustfmt.md) | [Source tree](source_tree/README.md) | format Rust code
[set-petal](cmd/set-petal.md) | [Source tree](source_tree/README.md) | configure jiri to manage a specific petal
[set-relay](cmd/set-relay.md) | [Other](other/README.md) | Actuates the state of an external relay by writing a single byte to \|tty\|.
[setup-go](cmd/setup-go.md) | [Other](other/README.md) | Set up the checkout for Go development.
[setup-usb-ethernet](cmd/setup-usb-ethernet.md) | [Other](other/README.md) | Setup udev rules for USB CDC ethernet
[show-package](cmd/show-package.md) | [Software delivery](software_delivery/README.md) | lists package contents
[shush](cmd/shush.md) | [Source tree](source_tree/README.md) | silence rust lints with allows or compiler suggested fixes
[size-check](cmd/size-check.md) | [Other](other/README.md) | Convenience wrapper for running the product size checker.
[smoke-test](cmd/smoke-test.md) | [Other](other/README.md) | Runs a Python helper script inside the fx environment
[smoke-test](cmd/smoke-test.md) | [Test](test/README.md) | Finds and runs tests affected by the current change.
[snapshot](cmd/snapshot.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Obtain and parse a snapshot from a connected target.
[sniff](cmd/sniff.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Fuchsia packet capture and display tool
[sniff.py](cmd/sniff.py.md) | [Other](other/README.md) |
[symbol-index](cmd/symbol-index.md) | [Build](build/README.md) | (deprecated) manipulate the symbol-index file
[sync-from-stem](cmd/sync-from-stem.md) | [Source tree](source_tree/README.md) | sync integration and deps to a state matching fuchsia.git state
[test-rustdoc](cmd/test-rustdoc.md) | [Test](test/README.md) | runs "fx rustdoc" on all rust targets
[test-stats](cmd/test-stats.md) | [Test](test/README.md) | Query and calculate test stats.
[test-stats.py](cmd/test-stats.py.md) | [Test](test/README.md) | Query and calculate test stats.
[traceutil](cmd/traceutil.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Fuchsia tracing utility
[triage](cmd/triage.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | generate a report of error conditions
[unarchive-package](cmd/unarchive-package.md) | [Software delivery](software_delivery/README.md) | unarchive a Fuchsia package archive in FAR format
[update-3p-owners](cmd/update-3p-owners.md) | [Source tree](source_tree/README.md) | updates OWNERS files for third\_party dependencies
[update-rust-3p-outdated](cmd/update-rust-3p-outdated.md) | [Source tree](source_tree/README.md) | updates external Rust dependencies with latest from crates.io
[update-rustc-third-party](cmd/update-rustc-third-party.md) | [Source tree](source_tree/README.md) | updates rustc\_library and rustc\_binary third\_party dependencies
[validate-sdk](cmd/validate-sdk.md) | [Build](build/README.md) | Attempt to build a few known SDK-based OOT repos based on a core SDK
[wipe-partition-tables](cmd/wipe-partition-tables.md) | [Other](other/README.md) | run bootserver for wiping partition tables
[zbi_json_to_d3js.py](cmd/zbi_json_to_d3js.py.md) | [Other](other/README.md) |
[zedmon](cmd/zedmon.md) | [Other](other/README.md) | run zedmon client
[zxdb](cmd/zxdb.md) | [Run, inspect and debug](run_inspect_and_debug/README.md) | Deprecated, please use "ffx debug connect"