This guide provides instructions for the following tasks:
Fuchsia's bootstrap script requires Python, cURL, unzip, and Git to be up-to-date.
Install or update the following packages:
sudo apt-get install build-essential curl git python unzip
Do the following:
Install the Xcode command line tool:
Install the latest version of Xcode.
Download Fuchsia source
Fuchsia's bootstrap script creates a
fuchsia directory and downloads the
content of the Fuchsia source repository to this new directory.
To download the Fuchsia source, do the following:
Go to the directory where you want to create your
fuchsiadirectory, for example:
Run the bootstrap script:
curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
Downloading may take up to 60 minutes.
To learn how the Fuchsia source code is organized, see Source code layout.
If you see the
Invalid authentication credentials error during the bootstrap
~/.gitcookies file may contain cookies from some
googlesource.com that the bootstrap script
wants to check out anonymously.
To resolve this error, do one of the following:
- Follow the onscreen directions to get passwords for the specified repositories.
- Delete the offending cookies from the
Set up environment variables
Setting up Fuchsia environment variables requires the following:
- Add the
.jiri_root/bindirectory to your
- Source the
.jiri_root/bin directory in the Fuchsia source contains
fx tools, which are essential to Fuchsia workflows.
Fuchsia uses the
jiri tool to manage multiple repositories in the Fuchsia project.
fx tool helps configure, build, run, and debug Fuchsia.
The Fuchsia toolchain requires
jiri to be available in your
Additionally, sourcing the
enables useful shell functions in your terminal. For
instance, it creates a
FUCHSIA_DIR environment variable and
fd command for navigating directories with auto-completion.
See comments in
fx-env.sh for details.
Update your shell script
Update your shell script to automatically set up Fuchsia environment variables in your terminal.
The following steps use a
bash terminal as an example:
Use a text editor to open your
Add the following lines your
~/.bashrcfile and save the file:
export PATH=~/fuchsia/.jiri_root/bin:$PATH source ~/fuchsia/scripts/fx-env.sh
Update your environment variables:
You can now run
fxin any directory.
Run the following commands in any directory and confirm that these commands print a usage guide for the tool:
Work on Fuchsia without updating your PATH
The following sections provide alternative approaches to the Update your shell script section.
Copy the tool to your binary directory
If you don't wish to update your environment variables, but you want
work in any directory, copy the
jiri tool to your
~/bin directory, for
cp ~/fuchsia/.jiri_root/bin/jiri ~/bin
However, you must have write access to the
~/bin directory without
If you don't,
jiri cannot keep itself up-to-date.
Add a symlink to your binary directory
Similarly, if you want to use the
fx tool without updating your environment
variables, provide the
fx tool's symlink in your
~/bin directory, for
ln -s ~/fuchsia/scripts/fx ~/bin
Alternatively, run the
fx tool directly using its path, for example:
In either case, you need
jiri in your
For the next steps, see Configure and build Fuchsia in the Getting started guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-03-18.