Build Android from source code

I am trying to build Android for hikey board from source code by following the instructions in section AOSP build of HiKeyGettingStarted (

Firstly, download the android source code by the followings
$ repo init -u platform/manifest - Git at Google -b android-5.1.1_r1 -g “default,-device,hikey”
$ cd .repo/
$ git clone -b android-5.0 local_manifests
$ cd -
$ repo sync -j8
$ source build/
$ lunch hikey-userdebug
$ make droidcore -j8
$ cd out/target/product/hikey


  1. How to build the kernel for Android?
    I have tried:
    $ cd kernel/linaro/hisilicon
    $ make help
    $ make x86_64_defconfig
    $ make menuconfig <— doesn’t work
    And which dts file is for building kernel (cannot find any dts for hi6620)?

  2. According to the section
    AOSP sources are hosted in these repositories:

Where to store these file to build Android?

Can someone to give a clear instructions?

Once you have built your aosp as explained above, if you want to rebuild the kernel do the following:

$ cd aosp
$ source build/
$ lunch hikey-userdebug
$ make -j8 boot_fatimage
$ cd out/target/product/hikey

look for your images in the above directory