1 Installing Xcode
Macport
Note: To determine/opt/local/bin before/usr/bin, if not, execute the following command, or modify the. bash_profile
Export Path=/opt/local/bin: $PATH
2 Install MAKE,GIT,GPG via Macport, if installed locally, or the version is newer, no installation required
sudo port install gmake libsdl git-core GnuPG
3 About make 3.82 version
Make 3.82 version has a bug, need to return 3.81, confirm the version with the following command
Make-v
GNU make 3.81
Copyright (C) 2006 free Software Foundation, Inc.
This was free software; See the source for copying conditions.
There is NO warranty; Not even to merchantability or FITNESS for A
Particular PURPOSE.
This program built for i386-apple-darwin11.0
Because my machine is already 3.81 version, so no operation this process, specifically can check the Android website
4 Modifying file descriptor limits
Add the following in ~/.bash_profile
# Set the number of open files to be 1024
Ulimit-s-N 1024
Two. Download the source code
1. Create a directory ~/bin
mkdir ~/bin
Add the following command to ~/.bash_profile
Export Path=~/bin: $PATH
2. Install repo, there is no use to install official website documentation, specific reasons you know
$ Curl https://git-repo.googlecode.com/files/repo-1.19 > ~/bin/repo
Then modify repo to execute permissions
chmod a+x ~/bin/repo
3. In order to facilitate the download, modify the repo file as follows
#REPO_URL = ' Http://gerrit.googlesource.com/git-repo '
Repo_url= ' http://code.google.com/p/git-repo/'
4. Create a source directory mkdir android-source ready to download
CD Android-source
5. Execute repo init, git library and official website is not the same, reason does not explain
Download source from Master
Repo Init-u Git://android.git.linaro.org/platform/manifest.git
or branch to download
Repo init-u git://android.git.linaro.org/platform/manifest.git-b "Branch Tag"
I chose a new android-4.4.2_r1.
Repo Init-u git://android.git.linaro.org/platform/manifest.git-b ANDROID-4.4.2_R1
You can view the source code corresponding to the tag that you want to download on the website.
After execution, there will be a directory locally. Repo
Then execute the repo sync download code in the Android-source directory
Download the code takes a long time, if you feel useless to continue to download, you can kill Ctrl + C, continue to perform repo sync until the download is complete.
Download completed, Android-source under a total of 27g,.repo 17G, source 10G about
Three. code can be compiled
Copy the code from the Android-source directory to the previously created partition/volumes/android, and under this partition you can delete the. Repo directory, which is useless and takes up a lot of space when compiling the code.
1. Initializing the compilation environment
SOURCE build/envsetup.sh
2. Select the compilation target, check the official website
Lunch Full-eng
3. Compiling the Code
Make
Or
Make-j4
OSX Android Compilation Environment