2015年7月15日 星期三

Android - How to build the AOSP Nexus 7 (2012) ?

1. Get source code from AOSP.

$mkdir nexus_7_2012
$cd nexus_7_2012

You must to check nexus 7 (2012) and aosp version:
http://source.android.com/source/build-numbers.html#source-code-tags-and-builds

For example, if you want get android 5.1.1 for nexus 7 (2012) wifi only source code, you can find ...


Because nexus 7 2012 wifi device name was "grouper", we can find the branch is android-5.1.1_r1.

$repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1
$repo sync

2. Get third-party binaries.

Get binaries from this address : https://developers.google.com/android/nexus/drivers
We want to build the android 5.1.1 , so we must to get ...


After get these files, please copy to your aosp folder and execute.
You will to get the new folder "vendor" in your source code folder.

3. Build the source code.

$source build/envsetup.sh

Find the device tag and name from this ...
http://source.android.com/source/building-devices.html

"full_grouper-userdebug" was "nexus 7 2012 wifi only" configuration name.


$lunch lunch full_grouper-userdebug

$make -j8

4. Flash to device. (Your device must to oem unlock.)

$adb reboot-bootloader
$fastboot -w flashall

PS. You must to input cmd on aosp folder.