Setting up FImage for Application Development
This guide will explain how to bring your existing Flutter application to Fuchsia using the Flutter SDK and FImage.
You'll need a few things before working with Flutter apps on Fuchsia.
Step 1 - Configuring Flutter for Fuchsia
Begin by upgrading Flutter to the
flutter channel master
Then, enable Fuchsia development, and upgrade the Flutter tool. It should download the Fuchsia SDK. If
flutter devices does not list the
fuchsia_fimage device, run this step again.
flutter config --enable-fuchsia flutter upgrade
Step 2 - Provisioning SSH Keys to FImage
To start, generate a new set of SSH keys for the emulator.
For the sake of organization, call the key
fimage_key. Don't set a password for the keypair. You should see an output similar to below.
Generating public/private rsa key pair. Enter file in which to save the key (/home/nmcain/.ssh/id_rsa): fimage_key Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in fimage_key Your public key has been saved in fimage_key.pub The key fingerprint is: SHA256:yJz40GaEI+pyfBaTgC9n2HGlGDBEBVYeLVV3PyCd99A [email protected] The key's randomart image is: +---[RSA 3072]----+ |=*=+o.o. o.o. . | |.o.+.= . oooo E | |. =.* . .oo | | = = O o .. | |+ = * O S | |.= B | |..o o . | |.. o | | | +----[SHA256]-----+
Now that the key has been generated, send the public key to FImage. Make sure the emulator is not started, and use the ZBI tool to inject the key.
./tools/zbi -o init/fuchsia-ssh.zbi init/fuchsia.zbi --entry data/ssh/authorized_keys=/home/$USER/.ssh/fimage_key.pub
Step 3 - Starting and Checking FImage
Now that SSH and the SDK are configured, you can start FImage.
./network-config ./fimage-gui 4096
In a new terminal, check that the emulator is running and recognized by Flutter, using the
flutter devices command.
Your device is now ready to run Flutter apps!
Step 4 - Preparing and Running a Flutter App
The instructions for this step can be found at Preparing and Running a Flutter App >