9/5/2019 Update: Many updates have been made to fuchsia, and many of these steps are no longer required. Small updates have been made where they were needed, but a majority of the content is outdated and irrelevant. The original content has been preserved for historical purposes.
With as quickly as Fuchsia is being developed, this may not be relevant for too long, but I hope that it can help at least a few people for the time being. Horus125 and I have been working on this for the past couple days or so and we're glad we finally got it working and are happy to share our process.
So, before we start, you're gonna need a few things.
Once you have the fuchsia source downloaded, we have to cherry-pick some currently-unmerged commits. The commits we're going to be cherry-picking are:
and to do that, you run these commands:
If everything merged in nicely, you're good to move on to the next step!
We need to clone a small part of AOSP in order for it to work, so run:
Now we're good to build!
Note: This should take a fair bit of time.
At this point, we have modified the fuchsia to add support for 'goldfish' (the Android Emulator), and have successfully built a goldfish-compatible version of fuchsia. However, there is one more step we need to take, and that's actually enabling Vulkan support for the Android Emulator. To do that, we run the following commands:
Now, to run it, we run the following command:
Where -g enables graphics, -k enables KVM, -E tells fx run to use the Android Emulator, and -q is used to specify the location of the emulator binaries.
9/5/2019 Update: aemu support is now native to fuchsia, so all you have to do is run the command:
If you get a black screen instead of a functioning emulator, please ensure the following:
If you're getting an error while building that relates to a missing newline in a file in the goldfish-opengl repo we cloned, add -Wno-newline-eof in between lines 84 and 85 of that repo's BUILD.gn file, such that the resulting cflags_cc define looks like this:
then attempt the build process again.
You should now have Fuchsia booting on the Android Emulator!
We're glad we were able to finally get everything working, and hope that you were able to, as well. I'll try to update this as things change, and if I get the time. Let me know down in the comments if you were able to follow this guide, and I'll try to respond to everyone when I get the chance.
Thank you, and have fun!
After messing with it for a bit, here's some extra information that Horus125 was able to come up with about ermine and running fuchsia in the Android Emulator: