How to flash Android 9 on Huawei Mate 9? Can I flash Android 9 built from source to Huawe Mate 9? Will it work? After build, there are these .img files:

cache.img
system.img
userdata.img
vbmeta.img
vendor-qemu.img
ramdisk.img
system-qemu.img
userdata-qemu.img
vendor.img

Do I have to flash them all, or just system.img and userdata.img?
I am afraid it will not work. Android system must be build for specific device which include modifications of code to meet hardware requirements of device. Such act require great knowledge of both hardware and software including low-level programming. However, if you really want to destroy your phone, I'll tell you how. Just have to say that what you get if you try it is called "Bricked Phone"

First of all, you need Scatter file. You can create one by following steps of this article. But before doing so... ...You need to download and install USB drivers. Pick them from this siteTo flash files into phone is used SmartPhone Flash Tool. Go ahead and download it.
 Now open SP flash tool and load and click on "Scatter-loading" button and select your scatter file. Keep on mind that you need to have all images in same folder as scatter file. From drop-down select "Download only". On your phone enable developer settings and enable USB debugging. Click "Download" button and connect phone to computer via. usb cable. Use this method only with professionally made roms. These roms came with own scatter file so you can skip first step.I'M NOT RESPONSIBLE FOR DESTRUCTION YOU DO TO YOUR PHONE, TRY IT AT OWN RISK. IF YOU TRY IT WITH IMAGES YOU BUILD, YOU WILL DESTROY YOUR PHONE, EVEN IF YOU TRY, I'M NOT RESPONSIBLE FOR IT