Setting Up Android Build
Get it from mipsia.review.mips.com
The following assumes you've created an account on the mipsia.review.mips.com Gerrit server.
cd some-new-directory repo init -u ssh://mipsia.review.mips.com:29418/platform/manifest.git -b portable-jb
Get it from Reed's machine
You can copy the source tarball from somewhere. For now, do the following:
- ssh ubuntu-rkotler
- scp dev-mips-jb.for_Reed.tar.gz <<<somewhere on your local disk or home directory>>>
- tar vfxz dev-mips-jb.for_Reed.tar.gz
- sudo chown -Rv <<<your user id.. i.e. rkotler>>> dev-mips-jb
- cd dev-mips-jb
The following is all you need if you're inside the Sunnyvale MIPS office and your desktop is configured correctly. If not, follow the manual install process.
export ANDROID_JAVA_HOME=/mips/tools/mips/swpkgs/lib/jdk1.6.0_32 export PATH="/mips/tools/mips/swpkgs/lib/jdk1.6.0_32/bin:$PATH" java -version
The java version should be java version "1.6.0_32". Note that all you really need is any recent point release of Java version 6. So, version 6u33 or 1.6.0_33 should work. Don't try to use Java 7.
Manually install java
If the java version is from openjdk, then you will need to download the sun version 6 jdk. Reed has placed it on ubuntu-rkotler in the /local directory as jdk-6u32-linux-x64.bin
- open up a new shell or just exist from the ssh.
- bash jdk-6u32-linux-x64.bin
- export ANDROID_JAVA_HOME=<<install place>>/jdk1.6.0_32
Prepare Android for building
Setup your environment so that you will be building a MIPS version of Android.
export TARGET_ARCH=mips . build/envsetup.sh lunch full_mips-eng
Use the following steps to build for arm:
export TARGET_ARCH=arm . build/envsetup.sh lunch full-eng
Additional step if using the tar file
If you installed it from the tar file, you'll need to clean up as well.
make -j 12 clean
At this point you should be in a directory with Android setup and ready to build. The build takes a long time. So, you may want to save the output to a file and time how long it takes. The following command does both of those things:
d=$(date) ; time make -j 12 2>&1 | tee Make.log; echo "Start: $d\nEnd: $(date)"
But, the simple command is just:
make -j 12
Start the emulator
Here are various ways to start the Android emulator. If you're running this on a server, you may need to have your DISPLAY variable set to a valid X server. The -no-window option will turn off the need for an X server.
Start the emulator with network, shell, kernel messages and no GUI
emulator -shell -show-kernel -no-window -dns-server 192.168.36.50,192.168.37.50
Start the emulator with QEMU
emulator -shell -show-kernel -qemu -s
Start the emulator with a GPU
Needs your DISPLAY variable set. If you're running the emulator on your desktop machine, then this should already be set. If you're on a server, this may not be set.
emulator -shell -show-kernel -gpu on -qemu -s
Start the emulator with a different skin
I'm not sure what the skin option actually does. When I tried this, it just errored out. Also, I couldn't find a file with 1280x800 in the name. So, that isn't the name of a skin for the GUI.
emulator -shell -show-kernel -gpu on -skin 1280x800
Start the emulator with a larger partition
Pass the emulator the -partition-size and the size in megabytes. The emulator will increase the size of your /system and /data directories to this size.
emulator -partition-size 512
Start the emulator with a sdcard
Although the mksdcard seems to make a file called sdcard.img, I'm not seeing any new partitions added to the emulator. The mksdcard program is part of Android. So, it probably pre-loads the sdcard with the standard /system partition.
mksdcard -l sdcard 512M sdcard.img emulator -partition-size 512 -sdcard sdcard.img
Exit the emulator
Since shutdown and exit and other commands don't work in the emulator, you may think you can't close it. In fact it's easy to close. Just press control C (hold down the Ctrl key and press the C key) in the window where you ran the emulator.
Create an account on Gerrit
These instructions assume you've setup a Google account and linked it to your MIPS e-mail address.
- Goto the Gerrit server
- Click on the Register link in the upper left corner of the page
- Click on the Register with a Google Account link
- Set the Username field to your MIPS user ID
- Set the Email Address to your MIPS e-mail
- Send an e-mail to Paul Lind or Chris Dearman letting them know you've registered his account. They will give you the access you need.