Building and Running AOSP on Nexus 5X

1,674 views
Skip to first unread message

Guru Prasad

unread,
Aug 3, 2016, 1:31:01 PM8/3/16
to Android Building
I've noticed that there are a few posts on how stock AOSP will not necessarily boot on the Nexus 5X. I've followed earlier posts that recommended grabbing this project and following the instructions provided there.

I've just about tried everything I could find and have had no luck.
I picked revision MDA89E (android-6.0.0_r12) which is the first revision to support Nexus 5X. Then, I tried the following:

fastboot flashall -w
  • Flash stock image provided by Google -> works fine
  • adb reboot bootloader && fastboot flashall -w
  • Does not boot

Individual fastboot flash

Curiously, on the Nexus 6P, I was able to get it to boot after flashing just system and userdata. So I tried that on the 5X.

  • Flash stock image provided by Google -> works fine
  • adb reboot bootloader && fastboot flash system && fastboot flash userdata && fastboot reboot
  • Does not boot

Add vendor directory created by android-prepare-vendor

  • Copy over vendor/ as created by android-prepare-vendor
  • make clean && make -j16
  • fastboot flashall -w
  • Does not boot

In all of the above, my lunch target was: aosp_bullhead-userdebug

In all of the above, after the boot didn't work, I tried flashing just the vendor image over. That didn't work either.



Could someone please provide comprehensive instructions on how to get an AOSP build running on the Nexus 5X?





Guru Prasad

unread,
Aug 4, 2016, 5:21:37 PM8/4/16
to Android Building
OK. Solved.

It turns out that the early versions of Android for the 5X and 6P don't work no matter what order you flash. Flashing stock, followed by flashing AOSP doesn't necessarily work.
My requirement was to stay as close to Lollipop (5.1.1_r4) as possible to ensure minimal platform changes. Clearly, this was not possible.

I finally moved to android-6.0.0_r26(MDB08M) as detailed in this post. On this platform, I am able to flash stock, and then flash AOSP and just have it work.
To flash AOSP, I used fastboot flashall -w.

Manmeet Khurana

unread,
Aug 8, 2016, 10:55:36 AM8/8/16
to Android Building
Hi Guru, 

I'm trying to build the AOSP for nexus 5X. I referred to:-
3. then i run the commands like "source ..", "lunch", "make -j32" etc from the android root.
4. finally from the out/target/product/bullhead:- i did "fastboot flashall -w".

This all seems to be working fine. But I don't know how to install gapps into this AOSP build. 
I can't sideload it. It gives error. 
I tried to flash the gapps zip using TWRP, flashing was successful. But device won't start up.

I also tried to include the gapps in the build time by refering to "https://github.com/opengapps/aosp_build". But over here the build fails. 

So do you have any idea about how to add the gapps into the AOSP build?

Guru Prasad

unread,
Oct 19, 2016, 4:51:33 PM10/19/16
to Android Building
I don't know if this is a solution, but you may want to take a look at https://github.com/opengapps/aosp_build/issues/63
Reply all
Reply to author
Forward
0 new messages