Disclaimer: Use the LayerCake research prototype and demo applications
for academic purposes only and at your own risk. View the license here.
This guide assumes that you have:
% mkdir -p ~/layercake/ % cd ~/layercake % repo init -u https://android.googlesource.com/platform/manifest -b android-4.2_r1 % repo sync ... waitNote: At this point, it is recommended that you build Android without any modifications. This will ensure that any build errors for your environment are resolved and are not confused with LayerCake build errors. For example:
% . build/envsetup.sh % lunch 1 % make -j4 ... wait % emulator ... ensure the build works
<manifest> <remote name="github" fetch="git://github.com" /> <remove-project name="platform/frameworks/base"/> <project path="frameworks/base" remote="github" name="Android-LayerCake/android_platform_frameworks_base"/> </manifest>Next, pull the source code.
% cd ~/layercake % repo sync % repo forall frameworks/base -c 'git checkout --track github/master && git pull'
Both the Nexus S and Galaxy Nexus require proprietary binaries not included in the AOSP release. Download the correct version of these files for your device from Google. Then extract the files in your source directory (~/layercake in the examples above).
Now we can build LayerCake. For the "lunch" command, replace <target> with the correct value for your device: full_crespo-eng for Nexus S, full_crespo4g-eng for Nexus S 4G, full_maguro-eng for Galaxy Nexus (GSM/HSPA+), full_toro-eng for Galaxy Nexus (Verizon), or full-eng for the Android emulator.
% . build/env_setup.sh % lunch <target> # (replace <target> with correct value for your device) % make clean % make -j4If you've built the emulator, you should now be able to launch it by simply executing the emulator command. If you've built a system image for a device, proceed to Step 2 (Installation).
In order to flash new images, the phone must be connected to the development PC via USB and booted in fastboot mode. Start with the phone powered down, then hold down the "volume up" button (Nexus S) or both "volume up" and "volume down" buttons (Galaxy Nexus) and press the power button. (Alternatively, you can use ADB to reboot into the bootloader by issuing the adb reboot bootloader command.) If you have problems using fastboot to flash your device, please refer to the documentation at source.android.com.
If you have not already unlocked your bootloader, first issue the following command to unlock the bootloader:
% fastboot oem unlockThen, follow the on-screen instructions on the phone to unlock the bootloader. Please note that this will void your warranty.
Before flashing images to your device, we reiterate our previous recommendation: It is strongly recommended that you use the nandroid tool provided in a custom recovery firmware such as ClockWorkMod to backup your current system before flashing new images to your device.
% cd out/target/product/<device> # (replace <device> with correct value for your device) % fastboot flash boot boot.img % fastboot flash system system.img % fastboot flash userdata userdata.img