With the significant news this week that the Fuchsia SDK and a Fuchsia “device” are being added to the Android Open Source Project, now seems like a good time to learn more about the Fuchsia SDK. Today on Fuchsia Friday, we dive into the Fuchsia SDK and see what it has to offer developers who might want to get a head start on Fuchsia.
Intro to the Fuchsia SDK
Generally speaking a software development kit (or SDK) is used to assist developers in creating applications. Some, like the Android SDK, are specially designed for one platform, and others, like Google’s Flutter SDK, can make apps for multiple platforms. The Fuchsia SDK, as you would expect, falls under the former category.
Currently, one cannot simply download the Fuchsia SDK and get to work, as Google has not made it publicly available. However, because the overwhelming majority of Fuchsia is open source, the SDK can be built and used accordingly.
The curious can find a download at the bottom of this article, but I obviously don’t recommend its usage for any major projects as it will swiftly become outdated and/or outright wrong. The tools in the included version are designed for use with 64-bit Linux, so if you’re on OS X, you’re on your own.
Note on Fuchsia SDK and Flutter SDK:
The Flutter SDK, despite what we know about Fuchsia’s relationship with Flutter, is not the same as the Fuchsia SDK. Just as Flutter uses the Android SDK to make Android apps today, you’ll likely be able to use the Fuchsia SDK through Flutter later on.
For now, we need to use the Fuchsia SDK directly to make Fuchsia apps. It’s actually possible to build Flutter apps directly using the Fuchsia SDK, because Flutter is deeply supported by Fuchsia.
Currently the Fuchsia SDK is capable of crafting applications written in C++, Dart, and Flutter (which is essentially also Dart). Regardless of which language or framework you choose to base your project upon, you’ll need to use Bazel to both manage your dependencies and handle the final build.
Bazel is a Google-built framework for building and testing software that aims to only rebuild aspects of your program that change. There’s a lot that can be learned about the intricacies of Bazel, but for our purposes, you just need to know that Bazel connects your app to libraries in the Fuchsia SDK, and uses the SDK’s included tools to actually build real, installable Fuchsia packages.
What’s in the Fuchsia SDK?
Developers who brave the wilds of the Fuchsia SDK will find access to many of the aspects of the platform we’ve uncovered over the past year. For example, inside of the “fuchsia_modular” Dart package, you’ll find the ability to work with agents, as managed by Maxwell, the ability to create proposals and work with entities. (Entities is a fairly generic term in Fuchsia, as you may remember.)
It’s even possible to work with the Zircon kernel layer from the SDK using Dart. There’s also the “fidl” package, which gives you access to Fuchsia’s ability to connect programs and functions written in different languages.
For C++ developers, there’s a host of lower-level packages available to use, including direct access to Vulkan (used for Fuchsia’s graphics), and resources made available by the Zircon kernel. FIDL also gives both Dart and C++ developers access to many other services and utilities available in Fuchsia like UI code, Bluetooth, WiFi, and even speech-to-text capabilities.
Getting the Fuchsia SDK
For developers who just want to take a closer peek at how they could one day bring their applications to Fuchsia, you can browse it in a newly created GitHub repo. For the sake of size, and to be sure we’re in compliance with licenses, we’ve only included code and libraries, not any binary files or copies of Fuchsia OS itself.
Reminder: The information within will become swiftly outdated, as Fuchsia is constantly in development and the SDK will continue to see changes for years to come. If you wish to build an application of your own on the Fuchsia SDK, I recommend building the SDK for yourself, often.
The best way to get a fresh copy is to build it yourself from the Fuchsia source code. If you’ve already got the Fuchsia source and associated tools downloaded to your (Linux or OS X) computer, you can build the SDK by using the commands below, then following these instructions.
fx set x64 --args=build_sdk_archives=true fx full-build
What can I do with it today?
Say you build the Fuchsia SDK today, what should you reasonably expect to be able to do with it? Without access to a Fuchsia device, not much. As we saw last week, however, Google is working on it, by slowly making the official Android Emulator compatible with Fuchsia.
If you do happen to have a Fuchsia device lying around, you should be able to use Bazel and the SDK to create a Fuchsia application. After some early struggles, I was actually able to build an example Flutter app for Fuchsia. We’ll dive further into that process very soon.
Fuchsia Friday is an irregular series where we dive into the Fuchsia source code and interpret what the current state of the OS might mean for the finished product. All information in this article is speculation based on available information and is subject to change.