Supported host platforms and build systems
The GN C++ Frontend SDK samples only support Linux hosts and the GN build system.
Supported Fuchsia device CPU architectures
Fuchsia devices or emulators must have one of the following CPU architectures to run Fuchsia:
Install required dependencies:
sudo apt-get install curl unzip python2
Clone the samples repo and submodules:
git clone https://fuchsia.googlesource.com/samples --recursive
Change directory to the root of the repo and run the tests:
cd samples ./scripts/setup-and-test.sh
- Downloads additional build tool dependencies (may take 5-30 minutes)
- Builds the samples
- Runs tests on your host
If the script fails with an error, address the issue and run the script again.
Testing on a Fuchsia compatible device
Create Ninja build files for the samples:
buildtools/gn gen out/generic-x64 --args='target_os="fuchsia" target_cpu="x64"'
Build the samples by executing the Ninja build files you created in the previous step:
buildtools/ninja -C out/generic-x64
Make sure your Fuchsia device is booted to Zedboot and connected to your host machine the pave your device:
Start a package server from your host machine:
To publish your packages open another another terminal window and run:
third_party/fuchsia-sdk/bin/fpublish.sh out/generic-x64/hello_far.far third_party/fuchsia-sdk/bin/fpublish.sh out/generic-x64/rot13_server.far third_party/fuchsia-sdk/bin/fpublish.sh out/generic-x64/rot13_client.far
Run the sample components on your Fuchsia device:
SSH to the device:
Once SSHed into the device, run the hello world component on the device:
Run the rot13 server:
In a new terminal window on your host machine, open a new ssh connection to your device, and run the rot13 client:
third_party/fuchsia-sdk/bin/fssh.sh run fuchsia-pkg://fuchsia.com/rot13_client#meta/rot13_client.cmx
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 2019-12-17.