ffx

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx [-c ] [-e ] [-t ] [-T ] [-v] [] [] Fuchsia’s developer tool

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -c, --config override default configuration
  4. -e, --env override default environment settings
  5. -t, --target apply operations across single or multiple targets
  6. -T, --timeout override default proxy timeout
  7. -v, --verbose use verbose output
  8. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

component Discover and manage components config View and switch default and user configurations daemon Interact with/control the ffx daemon doctor Run common checks for the ffx tool and host environment vdl Start and manage Fuchsia emulators overnet Interact with the Overnet mesh package Create and publish Fuchsia packages platform Manage platform build prerequisites scrutiny Audit the security of Fuchsia sdk Modify or query the installed SDKs self-test Execute the ffx self-test (e2e) suite target Interact with a target device or emulator trace Interact with the tracing subsystem version Print out ffx tool and daemon versions debug Start a debugging session.

  1. ## component
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx component <command> [<args>]
  4. Discover and manage components

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. knock Connect to a service on the target
  4. list List all components
  5. run Run a component on the target
  6. select Lists components matching a selector
  7. test Run test suite

knock

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx component knock Connect to a service on the target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To connect to a service:
  6. $ ffx component knock 'core/appmgr:out:fuchsia.hwinfo.Product'
  7. Notes:
  8. Knock verifies the existence of a service exposed by a component by
  9. attempting to connect to it. The command expects a <selector> with the
  10. following format:
  11. `<component moniker>:(in|out|exposed)[:<service name>].`
  12. Note that wildcards can be used but must match exactly one service.
  13. The `component select` command can be used to explore the component
  14. topology to compose the correct selector for use in `component knock`.
  15. Error codes:
  16. 1 Failed to connect to service

list

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx component list List all components

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To list all components in the topology:
  6. $ ffx component list
  7. Notes:
  8. Lists all the components on the running target. The command outputs a
  9. tree of all v1 and v2 components on the system.
  10. If the command fails or times out, ensure RCS is running on the target.
  11. This can be verified by running `ffx target list` and seeing the status
  12. on the RCS column.
  13. Error codes:
  14. 1 The command has timed out

run

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx component run [] Run a component on the target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To run the 'hello_world_rust' component:
  6. $ ffx component run \
  7. fuchsia-pkg://fuchsia.com/hello_world_rust#meta/hello_world_rust.cmx
  8. To run the Remote Control Service:
  9. $ ffx component run \
  10. fuchsia-pkg://fuchsia.com/remote-control#meta/remote-control-runner.cmx
  11. Notes:
  12. Runs a specified v1 component on the target. The <url> must follow the
  13. format:
  14. `fuchsia-pkg://fuchsia.com/<package>#meta/<component>.cmx`.

select

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx component select Lists components matching a selector

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To show services exposed by remote-control:
  6. $ ffx component select remote-control:expose:*'
  7. Or to show all services offered by v1 components:
  8. $ ffx component select core/appmgr:out:*
  9. Notes:
  10. Component select allows for looking up various services exposed by the
  11. component. The command expects a <selector> with the following format:
  12. `<component moniker>:(in|out|exposed)[:<service name>]`
  13. Wildcards may be used anywhere in the selector.
  14. Error codes:
  15. 1 No matching component paths found

test

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx component test [-t ] [—test-filter ] [—list] [—run-disabled] [—parallel ] [—count ] Run test suite

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -t, --timeout test timeout
  4. --test-filter a glob pattern for matching tests
  5. --list list tests in the suite
  6. --run-disabled run tests that have been marked disabled/ignored
  7. --parallel run tests in parallel
  8. --count number of times to run the test [default = 1]
  9. --help display usage information
  10. Notes:
  11. Runs a test or suite implementing the `fuchsia.test.Suite` protocol.
  12. Note that if running multiple iterations of a test and an iteration times
  13. out, no further iterations will be executed.

config

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx config [] View and switch default and user configurations

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

env list environment settings get display config values set set config settings remove remove config for a given level add add config value the end of an array analytics enable or disable analytics

  1. ### add
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config add <name> <value> [-l <level>] [-b <build-dir>]
  4. add config value the end of an array

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

-l, —level config level. Possible values are “user”, “build”, “global”. Defaults to “user”. -b, —build-dir an optional build directory to associate the build config provided - use used for “build” configs —help display usage information Notes: This will always add to the end of an array. Adding to a subtree is not supported. If the current value is not an array, it will convert the value to an array. If you want to insert a value in a different position, consider editing the configuration file directly. Configuration file locations can be found by running ffx config env get command.

  1. ### analytics
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config analytics <command> [<args>]
  4. enable or disable analytics

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. enable enable analytics
  4. disable disable analytics
  5. show show analytics

disable

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx config analytics disable disable analytics

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

enable

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx config analytics enable enable analytics

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

show

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx config analytics show show analytics

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

env

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx config env [] [] list environment settings

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

set set environment settings get list environment for a given level

  1. #### get
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config env get [<level>]
  4. list environment for a given level

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. #### set
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config env set <file> [-l <level>] [-b <build-dir>]
  4. set environment settings

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

-l, —level config level. Possible values are “user”, “build”, “global”. Defaults to “user”. -b, —build-dir an optional build directory to associate the build config provided - use used for “build” configs —help display usage information

  1. ### get
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config get [<name>] [-p <process>] [-s <select>] [-b <build-dir>] [-o <output>]
  4. display config values

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

-p, —process how to process results. Possible values are “raw”, “sub”, and “sub_flat”. Defaults to “raw”. Currently only supported if a name is given. -s, —select how to collect results. Possible values are “first” and “all”. Defaults to “first”. If the value is “first”, the first value found in terms of priority is returned. If the value is “all”, all values across all configuration levels are aggregrated and returned. Currently only supported if a name is given. -b, —build-dir an optional build directory to associate the build config provided - use used for “build” configs -o, —output [DEPRECATED] The output type will always be JSON. —help display usage information Error codes: 2 No value found

  1. ### remove
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config remove <name> [-l <level>] [-b <build-dir>]
  4. remove config for a given level

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

-l, —level config level. Possible values are “user”, “build”, “global”. Defaults to “user”. -b, —build-dir an optional build directory to associate the build config provided - use used for “build” configs —help display usage information Notes: This will remove the entire value for the given name. If the value is a subtree or array, the entire subtree or array will be removed. If you want to remove a specific value from an array, consider editing the configuration file directly. Configuration file locations can be found by running ffx config env get command.

  1. ### set
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx config set <name> <value> [-l <level>] [-b <build-dir>]
  4. set config settings

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

-l, —level config level. Possible values are “user”, “build”, “global”. Defaults to “user”. -b, —build-dir an optional build directory to associate the build config provided - use used for “build” configs —help display usage information

  1. ## daemon
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx daemon <command> [<args>]
  4. Interact with/control the ffx daemon

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. crash crash the daemon
  4. echo run echo test against the daemon
  5. log Dumps the daemon log
  6. start run as daemon
  7. stop stops a running daemon

crash

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx daemon crash crash the daemon

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

echo

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx daemon echo [] run echo test against the daemon

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

log

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx daemon log Dumps the daemon log

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

start

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx daemon start run as daemon

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

stop

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx daemon stop stops a running daemon

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

debug

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx debug [] Start a debugging session.

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

doctor

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx doctor [—retry-count ] [—retry-delay ] [—restart-daemon] [—record] [—record-output ] Run common checks for the ffx tool and host environment

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --retry-count number of times to retry failed connection attempts.
  4. --retry-delay timeout delay when attempting to connect to the daemon or
  5. RCS
  6. --restart-daemon
  7. if true, forces a daemon restart, even if the connection
  8. appears to be working
  9. --record if true, generates an output zip file that can be attached
  10. to a monorail issue
  11. --record-output sets the output directory for doctor records. Only valid
  12. when --record is provided. Defaults to the current directory
  13. --help display usage information

overnet

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx overnet [] Interact with the Overnet mesh

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

list-peers List known peer nodes list-links List links on a particular peer host-pipe Use stdin/stdout as a link to another overnet instance full-map Construct a detailed graphviz map of the Overnet mesh - experts only!

  1. ### full-map
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx overnet full-map --exclude-self <exclude-self>
  4. Construct a detailed graphviz map of the Overnet mesh - experts only!

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—exclude-self if set, exclude the onet tool from output —help display usage information

  1. ### host-pipe
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx overnet host-pipe
  4. Use stdin/stdout as a link to another overnet instance

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. ### list-links
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx overnet list-links <nodes>
  4. List links on a particular peer

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. ### list-peers
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx overnet list-peers
  4. List known peer nodes

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. ## package
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx package <command> [<args>]
  4. Create and publish Fuchsia packages

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. build Builds a package.
  4. Entries may be specified as:
  5. -
  6. <dst>=<src>: Place the file at path <src> into the package
  7. at path <dst>.
  8. - @<manifest-file>: Read each line of this
  9. file as an entry. This is not recursive; you can't put
  10. another @<manifest-file>
  11. export export a package archive
  12. import import a package archive

build

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx package build [] [—source-dir ] [—hash-out ] [—depfile ] Builds a package. Entries may be specified as:

  • =: Place the file at path into the package at path .
  • @: Read each line of this file as an entry. This is not recursive; you can’t put another @ ```

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—source-dir base directory for the part of entries; defaults to the current directory —hash-out write the package hash to this file instead of stdout —depfile write a gcc-format depfile for use in build systems —help display usage information

  1. ## platform
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx platform <command> [<args>]
  4. Manage platform build prerequisites

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. preflight Evaluate suitability for building and running Fuchsia

preflight

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx platform preflight Evaluate suitability for building and running Fuchsia

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

scrutiny

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx scrutiny [] Audit the security of Fuchsia

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

shell Run the scrutiny shell

  1. ### shell
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx scrutiny shell [<command>]
  4. Run the scrutiny shell

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. ## sdk
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx sdk <command> [<args>]
  4. Modify or query the installed SDKs

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. version Retrieve the version of the current SDK

version

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx sdk version Retrieve the version of the current SDK

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

self-test

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx self-test [—timeout ] [—case-timeout ] [—include-target ] Execute the ffx self-test (e2e) suite

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --timeout maximum runtime of entire test suite in seconds
  4. --case-timeout maximum run time of a single test case in seconds
  5. --include-target include target interaction tests
  6. --help display usage information

target

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target [] Interact with a target device or emulator

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

add Make the daemon aware of a specific target default Manage the default target flash Flash an image to a target device get-ssh-address Get the target’s ssh address list List all targets log
off Powers off a target reboot Reboots a target remove Make the daemon forget a specific target status Display status information for the target update Update base system software on target Notes: The target subcommand contains various commands for target management and interaction. Typically, this is the entry workflow for users, allowing for target discovery and provisioning before moving on to component or session workflows once the system is up and running on the target. Most of the commands depend on the RCS (Remote Control Service) on the target.

  1. ### add
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx target add <addr>
  4. Make the daemon aware of a specific target

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information Examples: To add a remote target forwarded via ssh: $ ffx target add 127.0.0.1:8022 Or to add a target using its IPV6: $ ffx target add fe80::32fd:38ff:fea8:a00a Notes: Manually add a target based on its IP address. The command accepts IPV4 or IPV6 addresses, including a port number: <addr> = <ip addr:port>. Typically, the daemon automatically discovers targets as they come online. However, manually adding a target allows for specifying a port number or address, often used for remote workflows.

  1. ### default
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx target default <command> [<args>]
  4. Manage the default target

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. get Get the default configured target
  4. set Set the default target
  5. unset Clears the default configured target
  6. Examples:
  7. For one-off overrides for the default use `--target` option:
  8. $ ffx --target <target name> <subcommand>
  9. Or use the `--config` option:
  10. $ ffx --config target.default=<target name> <subcommand>
  11. Notes:
  12. Manages the default configured target for all operations. The default
  13. target is designated by a `*` next to the name. This is an alias for the
  14. `target.default` configuration key.

get

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target default get Get the default configured target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Notes:
  5. Returns the default configured target from the 'User Configuration'.
  6. Returns an empty string if no default is configured.

set

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target default set [-l ] [-b ] Set the default target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -l, --level config level, such as 'user', 'build', or 'global'
  4. -b, --build-dir optional directory to associate the provided build config
  5. --help display usage information
  6. Examples:
  7. To set the default target:
  8. $ ffx target default set <target name>
  9. To set the 'target.default` key at the global configuration:
  10. $ ffx target default set -l global <target name>
  11. To specify a default target for a specific build directory:
  12. $ ffx target default set -l build -b ~/fuchsia/out <target name>
  13. Notes:
  14. Sets the `target.default` configuration key. By default sets the key in
  15. the 'User Configuration'. Can be used in conjuction with `ffx target list`
  16. to list the names of the discovered targets.
  17. After setting the default target, `ffx target list` will mark the default
  18. with a `*` in the output list.

unset

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target default unset [-l ] [-b ] Clears the default configured target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -l, --level config level, such as 'user', 'build', or 'global'
  4. -b, --build-dir optional directory to associate the provided build config
  5. --help display usage information
  6. Examples:
  7. To clear the default target:
  8. $ ffx target default unset
  9. To clear the `target.default` key from global configuration:
  10. $ ffx target default unset -l global
  11. To specify a specific build directory:
  12. $ ffx target default unset -l build -b ~/fuchsia/out
  13. Notes:
  14. Clears the `target.default` configuration key. By default clears the
  15. 'User Configuration'. Returns a warning if the key is already empty.

flash

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target flash [] [—oem-stage ] Flash an image to a target device

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --oem-stage oem staged file - can be supplied multiple times
  4. --help display usage information
  5. Examples:
  6. To flash a specific image:
  7. $ ffx target flash ~/fuchsia/out/flash.json fuchsia
  8. To include SSH keys as well:
  9. $ ffx target flash
  10. --oem-stage add-staged-bootloader-file ssh.authorized_keys,
  11. ~/fuchsia/.ssh/authorized_keys
  12. ~/fuchsia/out/default/flash.json
  13. fuchsia
  14. Notes:
  15. Flases an image to a target device using the fastboot protocol.
  16. Requires a specific <manifest> file and <product> name as an input.
  17. This is only applicable to a physical device and not an emulator target.
  18. The target device is typically connected via a micro-USB connection to
  19. the host system.
  20. The <manifest> format is a JSON file generated when building a fuchsia
  21. <product> and can be found in the build output directory.
  22. The `--oem-stage` option can be supplied multiple times for several OEM
  23. files. The format expects a single OEM command to execute after staging
  24. the given file.
  25. The format for the `--oem-stage` parameter is a comma separated pair:
  26. '<OEM_COMMAND>,<FILE_TO_STAGE>'

get-ssh-address

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target get-ssh-address [-t ] Get the target’s ssh address

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -t, --timeout the timeout in seconds [default = 1.0]
  4. --help display usage information
  5. Notes:
  6. Return the SSH address of the default target defined in the
  7. `target.default` key. By default this comes from the 'User Configuration'.
  8. The command takes a <timeout> value in seconds with a default of `1.0`
  9. and overrides the value in the `target.interaction.timeout` key.
  10. Error codes:
  11. 1 Timeout while getting ssh address

list

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target list [] [-f ] List all targets

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -f, --format determines the output format for the list operation
  4. --help display usage information
  5. Examples:
  6. To list targets in short form:
  7. $ ffx target list --format s
  8. fe80::4415:3606:fb52:e2bc%zx-f80ff974f283 pecan-guru-clerk-rhyme
  9. To list targets with only their addresses:
  10. $ ffx target list --format a
  11. fe80::4415:3606:fb52:e2bc%zx-f80ff974f283
  12. Notes:
  13. List all targets that the daemon currently has in memory. This includes
  14. manually added targets. The daemon also proactively discovers targets as
  15. they come online. Use `ffx target list` to always get the latest list
  16. of targets.
  17. The default target is marked with a '*' next to the node name. The table
  18. has the following columns:
  19. NAME = The name of the target.
  20. TYPE = The product type of the target, currently always 'Unknown'.
  21. STATE = The high-level state of the target, currently always 'Unknown'.
  22. AGE = Shows the last time the daemon was able to discover the target.
  23. ADDRS/IP = The discovered and known addresses of the target.
  24. RCS = Indicates if the Remote Control Service is running on the target.
  25. The NAME column shows the target's advertised name. When the target is
  26. in early boot state such as fastboot, shows 'FastbootDevice' with the
  27. `product` and `serial` attributes instead.
  28. By default, the `list` command outputs in a tabular format. To override
  29. the format, pass `--format` and can take the following options: 'simple'
  30. , 'tabular|table|tab', 'addresses|addrs|addr', 'json|JSON' or in short form 's', 't',
  31. 'a', 'j'.

log

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target log []

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

watch Watches for and prints logs from a target. Optionally dumps recent logs first. dump Dumps all logs from a target.

  1. #### dump
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx target log dump
  4. Dumps all logs from a target.

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. #### recent
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Unrecognized argument: recent

watch

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target log watch [—dump ] Watches for and prints logs from a target. Optionally dumps recent logs first.

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --dump if true, dumps recent logs before printing new ones.
  4. --help display usage information

off

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target off Powers off a target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Notes:
  5. Power off a target. Uses the 'fuchsia.hardware.power.statecontrol.Admin'
  6. FIDL API to send the power off command.
  7. The 'fuchsia.hardware.power.statecontrol.Admin' is exposed via the 'appmgr'
  8. component. To verify that the target exposes this service, `ffx component
  9. select` or `ffx component knock` can be used.
  10. Error codes:
  11. 1 Timeout while powering off target.

reboot

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target reboot [-b] [-r] Reboots a target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -b, --bootloader reboot to bootloader
  4. -r, --recovery reboot to recovery
  5. --help display usage information
  6. Notes:
  7. Reboot a target. Uses the 'fuchsia.hardware.power.statecontrol.Admin'
  8. FIDL API to send the reboot command.
  9. By default, target boots fully. This behavior can be overrided by passing
  10. in either `--bootloader` or `--recovery` to boot into the bootloader or
  11. recovery, respectively.
  12. The 'fuchsia.hardware.power.statecontrol.Admin' is exposed via the 'appmgr'
  13. component. To verify that the target exposes this service, `ffx component
  14. select` or `ffx component knock` can be used.
  15. Error codes:
  16. 1 Timeout while powering off target.

remove

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target remove Make the daemon forget a specific target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To remove a target by its target name:
  6. $ ffx target remove correct-horse-battery-staple
  7. Or to remove a target using its IP address:
  8. $ ffx target remove fe80::32fd:38ff:fea8:a00a
  9. Notes:
  10. IP addresses are matched by their full string representation.
  11. for best results, copy the exact address from ffx target list.

status

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target status [—desc] [—label] [—json] [—version] Display status information for the target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --desc display descriptions of entries
  4. --label display label of entries
  5. --json formats output as json objects
  6. --version display version
  7. --help display usage information
  8. Notes:
  9. Displays a detailed runtime status information about the target.
  10. The default output is intended for a human reader. This output can be
  11. decorated with machine readable labels (--label) and descriptions of
  12. each field (--desc).
  13. The 'label' fields in the machine readable output (--json) will remain
  14. stable across software updates and is not localized (compare to 'title'
  15. which may change or be localized). The 'value' field will be one of:
  16. 'null', 'bool', 'string', or a list of strings.
  17. Error codes:
  18. 1 Timeout retrieving target status.

update

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update [] Update base system software on target

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

channel View and manage update channels check-now Check and perform the system update operation force-install Trigger the system updater manually Notes: This command interfaces with system update services on the target.

  1. #### channel
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx target update channel <command> [<args>]
  4. View and manage update channels

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. get-current Return the currently configured update channel
  4. get-next Return the next or target update channel
  5. set Sets the update channel
  6. list List the known update channels
  7. Notes:
  8. Channel management commands and operations. Interfaces directly with
  9. the 'fuchsia.update.channelcontrol.ChannelControl' service on the target
  10. system.
get-current

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update channel get-current Return the currently configured update channel

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Notes:
  5. For developer product configurations, this is by default 'devhost'.
  6. Error codes:
  7. 1 Timeout while getting update channel.
get-next

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update channel get-next Return the next or target update channel

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Notes:
  5. Returns the next or target channel. This differs from `get` when the
  6. next successful update changes the configured update channel on the
  7. system.
  8. Error codes:
  9. 1 Timeout while getting update channel.
list

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update channel list List the known update channels

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Notes:
  5. This lists all the known next or target update channels on the system.
  6. Returns an empty list if no other update channels are configured.
  7. Error codes:
  8. 1 Timeout while getting list of update channel.
set

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update channel set Sets the update channel

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information
  4. Examples:
  5. To list all the known update channels:
  6. $ ffx target update channel list
  7. Then, use a valid channel from the list:
  8. $ ffx target update channel set <channel>
  9. Notes:
  10. Sets the next or target update channel on the device. When paired with
  11. `ffx target update check-now`, ensures the update is check against the
  12. next or target channel. When the update is successful, next or target
  13. channel becomes the current channel.
  14. Use `ffx target update channel list` to list known system update
  15. channels.
  16. Error codes:
  17. 1 Timeout while setting update channel.

check-now

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update check-now [—service-initiated] [—monitor] Check and perform the system update operation

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --service-initiated
  4. the update check was initiated by a service, in the
  5. background.
  6. --monitor monitor for state update.
  7. --help display usage information
  8. Examples:
  9. To check for update and monitor progress:
  10. $ ffx target update check-now --monitor
  11. Notes:
  12. Triggers an update check operation and performs the update if available.
  13. Interfaces using the 'fuchsia.update Manager' protocol with the system
  14. update service on the target.
  15. The command takes in an optional `--monitor` switch to watch the progress
  16. of the update. The output is displayed in `stdout`.
  17. The command also takes an optional `--service-initiated` switch to indicate
  18. a separate service has initiated a check for update.

force-install

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx target update force-install [—reboot ] Trigger the system updater manually

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --reboot automatically trigger a reboot into the new system
  4. --help display usage information
  5. Examples:
  6. With a known update package URL, trigger an update:
  7. $ ffx target update force-install fuchsia-pkg://fuchsia.com/update
  8. Also trigger a reboot after update:
  9. $ ffx target update force-install
  10. fuchsia-pkg://fuchsia.com/update
  11. --reboot
  12. Notes:
  13. Directly invoke the system updater to install the provided update,
  14. bypassing any update checks.
  15. Interfaces using the 'fuchsia.update.installer' protocol to update the
  16. system. Requires an <update_pkg_url> in the following format:
  17. `fuchsia-pkg://fuchsia.com/update`
  18. Takes an optional `--reboot <true|false>` to trigger a system reboot
  19. after update has been successfully applied.

trace

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx trace [] Interact with the tracing subsystem

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. --help display usage information

Commands:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

list-providers List the target’s trace providers record Record a trace

  1. ### list-providers
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx trace list-providers
  4. List the target's trace providers

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—help display usage information

  1. ### record
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx trace record [--buffer-size <buffer-size>] [--categories <categories>] [--duration <duration>] [--output <output>]
  4. Record a trace

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—buffer-size size of per-provider trace buffer in MB. Defaults to 4. —categories comma-separated list of categories to enable. Defaults to “app,audio,benchmark,blobfs,gfx,input,kernel:meta, kernel:sched,ledger,magma,minfs,modular,view,flutter, dart,dart:compiler,dart:dart,dart:debugger,dart:embedder, dart:gc,dart:isolate,dart:profiler,dart:vm” —duration duration of trace capture in seconds. Defaults to 10 seconds. —output name of output trace file. Defaults to trace.fxt. —help display usage information

  1. ## vdl
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. Usage: ffx vdl [--sdk] <command> [<args>]
  4. Start and manage Fuchsia emulators

Options:

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

—sdk running in fuchsia sdk (not inside the fuchsia code repository) —help display usage information

  1. __Commands:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. start Starting Fuchsia Emulator
  4. kill Killing Fuchsia Emulator

kill

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx vdl kill [-d ] [—launched-proto ] Killing Fuchsia Emulator

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -d, --vdl-path device_launcher binary location. Defaults to looking in
  4. prebuilt/vdl/device_launcher
  5. --launched-proto required, file containing device_launcher process artifact
  6. location.
  7. --help display usage information

start

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx vdl start [-H] [-N] [—host-gpu] [—software-gpu] [—hidpi-scaling] [-u ] [—packages-to-serve ] [-p ] [-w ] [-h ] [-s ] [-f ] [-e ] [—aemu-version ] [-d ] [—vdl-version ] [-x ] [-X ] [—grpcwebproxy-version ] [-v ] [—gcs-bucket ] [—image-name ] [-l ] [—port-map ] [—vdl-output ] [—nointeractive] Starting Fuchsia Emulator

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -H, --headless bool, run emulator in headless mode.
  4. -N, --tuntap bool, run emulator with emulated nic via tun/tap.
  5. --host-gpu bool, run emulator with host GPU acceleration, this doesn't
  6. work on remote-desktop with --headless.
  7. --software-gpu bool, run emulator without host GPU acceleration, default.
  8. --hidpi-scaling bool, enable pixel scaling on HiDPI devices.
  9. -u, --upscript path to tun/tap upscript, this script will be executed
  10. before booting up FEMU.
  11. --packages-to-serve
  12. comma separated string of fuchsia package urls, extra
  13. packages to serve after starting FEMU.
  14. -p, --pointing-device
  15. set pointing device used on emulator: mouse or touch screen.
  16. Allowed values are "touch", "mouse". Default is "touch".
  17. -w, --window-width
  18. emulator window width. Default to 1280.
  19. -h, --window-height
  20. emulator window height. Default to 800.
  21. -s, --image-size extends storage size to <size> bytes. Default is "2G".
  22. -f, --device-proto
  23. path to fuchsia virtual device configuration, if not
  24. specified a generic one will be generated.
  25. -e, --aemu-path path to aemu location. When running in fuchsia repo,
  26. defaults to looking in prebuilt/third_party/aemu/PLATFORM.
  27. When running in fuchsia sdk, defaults to looking in
  28. $HOME/.fuchsia/femu.
  29. --aemu-version label used to download AEMU from CIPD. Default is
  30. "integration". Download only happens if aemu binary cannot
  31. be found from known paths.
  32. -d, --vdl-path device_launcher binary location. When running in fuchsia
  33. repo, defaults to looking in prebuilt/vdl/device_launcher.
  34. When running in fuchsia sdk, defaults to looking in
  35. directory containing `fvdl`.
  36. --vdl-version label used to download vdl from CIPD. Default is "latest".
  37. Download only happens if vdl (device_launcher) binary cannot
  38. be found from known paths.
  39. -x, --grpcwebproxy
  40. enable WebRTC HTTP service on port, if set to 0 a random
  41. port will be picked
  42. -X, --grpcwebproxy-path
  43. location of grpcwebproxy, When running in fuchsia repo,
  44. defaults to looking in prebuilt/third_party/grpcwebproxy
  45. When running in fuchsia sdk, defaults to looking in
  46. $HOME/.fuchsia/femu.
  47. --grpcwebproxy-version
  48. label used to download grpcwebproxy from CIPD. Default is
  49. "latest". Download only happens if --grpcwebproxy is set and
  50. grpcwebproxy binary cannot be found from known paths or path
  51. specified by --grpcwebproxy_path.
  52. -v, --sdk-version fuchsia sdk ID used to fetch from gcs, if specified, the
  53. emulator will launch with fuchsia sdk files fetched from
  54. gcs. To find the latest version run `gsutil cat
  55. gs://fuchsia/development/LATEST_LINUX`.
  56. --gcs-bucket gcs bucket name. Default is "fuchsia".
  57. --image-name image file name used to fetch from gcs. Default is
  58. "qemu-x64". To view availabe image names run `gsutil ls -l
  59. gs://fuchsia/development/$(gsutil cat
  60. gs://fuchsia/development/LATEST_LINUX)/images`.
  61. -l, --emulator-log
  62. file path to store emulator log. Default is a temp file that
  63. is deleted after `fvdl` exits.
  64. --port-map host port mapping for user-networking mode. This flag will
  65. be ignored if --tuntap is used. If not specified, an ssh
  66. port on host will be randomly picked and forwarded. ex:
  67. hostfwd=tcp::<host_port>-:<guest_port>,hostfwd=tcp::<host_port>-:<guest_port>
  68. --vdl-output file destination to write `device_launcher` output. Required
  69. for --nointeractive mode. Default is a temp file that is
  70. deleted after `fvdl` exits. Specify this flag if you plan to
  71. use the `kill` subcommand.
  72. --nointeractive bool, turn off interactive mode. if turned off, fvdl will
  73. not land user in ssh console. A ssh port will still be
  74. forwarded. User needs to specify --vdl-output flag with this
  75. mode, and manually call the `kill` subcommand to perform
  76. clean shutdown.
  77. --help display usage information

version

```none {: style=”white-space: break-spaces;” .devsite-disable-click-to-copy}

Usage: ffx version [-v] Print out ffx tool and daemon versions

  1. __Options:__
  2. ```none {: style="white-space: break-spaces;" .devsite-disable-click-to-copy}
  3. -v, --verbose if true, includes details about both ffx and the daemon
  4. --help display usage information