Setup First, you'll need to install the prerequisites for your platform. This means you'll have git, a C compiler, etc. There are quite a few steps here, and it's all platform dependent, so go to the official build instructions where we have detailed instructions: http://source.android.com/source/initializing.html. Pay careful attention. For example, on a Mac you will need to work on a case-sensitive filesystem image, which is not the OSX default. One other Mac specific tip, which is not in the main Android page yet, is that Apple's recent JDK update "broke" the Android build on Snow Leopard since the build uses JNI. The location of the JNI header file changed or disappeared with the JDK update, so you now need to go to Apple and get the developer SDK, JavaDeveloper.pkg from http://connect.apple.com. Once you have everything configured, check out the source code using the following commands in a bash shell: $ mkdir android $ cd android $ repo init -u https://android.googlesource.com/platform/manifest $ repo sync The default repo init command will checkout a lot of items that you may not want. Here's a list of packages that have their own group name, allowing you to decide if you want them or not.
By default, only the default packages are downloaded. You can add optional (notdefault) packages, and you can also ommit default packages that have their own. This is done with the -g option. Ommiting this option is the same as doing
For instance, downloading the tree to work on ARM system image for the emulator only from a linux workstation you can do:
To work only on the developer tools, and build the Eclipse bundle from a MacOS X desktop, you can do:
In the future we hope to reduce this to: -g tools,eclipse by decoupling the tools from the platform build system Note: at any time after an initial repo init/sync, you can update the list of packages you need by running
Existing packages that are not needed will be removed, restoring storage space. During the repo init command, it will ask you for your name and e-mail address; these will be used later if you decide to check in changesets and upload them for review. For full, up to date instructions please look at http://source.android.com/source/downloading.html. Builing the Linux and MacOS SDK Now you are ready to build. While you could just type "make", this is where our SDK build instructions diverge a bit from the default build. In a bash shell, run these commands: $ . build/envsetup.sh $ lunch sdk-eng $ make sdk That will run for quite a while and build a full SDK. The result is located at out/host/platform/sdk/android-sdk_eng.username_platform-x86/ Building the Windows SDK Full Windows SDK builds are only supported on Linux -- most of the framework is not designed to be built on Windows so technically the Windows SDK is build on top of a Linux SDK where a few binaries are replaced. Setup: $ sudo apt-get install mingw32 tofrodos mingw32 is the cross-compiler, tofrodos adds a unix2dos command To build: $ . build/envsetup.sh $ lunch sdk-eng $ make win_sdk Note that this will build both a Linux SDK then a Windows SDK. The result is located at out/host/windows/sdk/android-sdk_eng.username_windows/ Next steps The next step is preparing your setup depending on which project you want to work on:
|
