User Tools

Site Tools


linux:android-source-compile-galaxy-nexus

This is an old revision of the document!


Compile Android source code for Galaxy Nexus

Compile the Android JB 4.1,need 64 bit linux,so use VirtualBox to install Ubuntu 12.04.

Google Official build guide

jdk1.6:

http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.bin

Download it and move to /opt:

chmod +x jdk-6u31-linux-x64.bin
./jdk-6u31-linux-x64.bin

After install,append folloing config to /etc/profile:

export JAVA_HOME=/opt/jdk1.6.0_31
export JRE_HOME=/opt/jdk1.6.0_31/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

Use java -version to check it is correct:

java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

VirtualBox Share:

1. Fist add file share in VirtualBox setting.The share file name:Android 2.Then mount it in the Ubuntu:

mount -t vboxfs Android /mnt/Android

Or add to /etc/fstab:

Android /mnt/Android vboxsf rw,gid=100,uid=1000,auto 0 0

Resize the VirtualBox VDI

Resize to 40G

VBoxManage modifyhd android_vhdd.vdi --resize 40000

Then use gparted to resize the origin extend partitoin.

ClockworkMod Recovery

Download recovery here:

http://www.clockworkmod.com/rommanager/

http://download2.clockworkmod.com/recoveries/recovery-clockwork-6.0.1.0-maguro.img

fastboot flash recovery recovery-clockwork-6.0.1.0-maguro.img

Install su/Superuser.apk

Enter fastboot mode

Volume UP+DOWN+Power

gapps download

fastboot

USAGE:http://wiki.cyanogenmod.com/wiki/Fastboot

1. fastboot flash system system.img 
2. fastboot flash boot boot.img
3. fastboot -w

NOTICE:it will format the sdcard,so need backup the data on sdcard first.

/var/www/dokuwiki/wiki/data/attic/linux/android-source-compile-galaxy-nexus.1344439554.txt.gz · Last modified: 2016/05/05 13:06 (external edit)