Android source download and installation:
1. Initialize the installation environment:
A. To create a case sensitive hard disk image:
The steps are as follows:
Disk utility–> New Image, take a name, here with ANDROIDDISK,30GB enough, and then pay attention to choose Mac OS Extended (case-sensitive, journaled),–> Create
Remember to save the road for
~/androiddisk.dmg
B. Mount Image:
Use the command:
Hdiutil Attach ~/androiddisk.dmg-mountpoint/volumes/android
Google's official online recommendation to add this line to ~/.bash_profile, so that each time with the mountandroid command on the line.
# mount the Android file image function mountandroid {hdiutil attach ~/androiddisk.dmg-mountpoint/volumes/android;}
(remember correct writing of path and file name)
C. Install Xcode and MacPorts:
Xcode does not have to say more, macports from http://www.macports.org/install.php download:
Before installing MacPorts you need to confirm the environment variable path,/opt/local/bin appears before/usr/bin, you can run this line to confirm:
$ echo $PATH
Otherwise, run it:
$ export Path=/opt/local/bin: $PATH
and add the above line to the ~/.bash_profile.
D. Install make, git, and GPG packages from MacPorts:
$ posixly_correct=1 sudo port install gmake libsdl git-core GnuPG
If you are a version of Mac OS X 10.4, install a bison
$ posixly_correct=1 sudo port install Bison
E. Below to restore the Gmake 3.82 to 3.81, otherwise compile the source code will be error: (3.82 There is a bug, not used):
$ sudo vim/opt/local/etc/macports/sources.conf
and add it to the top line of rsync.
File:///Users/Shared/dport
Then follow this step to get it done:
$ mkdir/users/shared/dports
$ cd/users/shared/dports/
$ svn Co--revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/devel/gmake/
$ portindex/users/shared/dports
To install version 3.81:
$ sudo port install gmake @3.81
Check the gmake version and see that the version number is 3.81:
$ gmake--version
So the last step before downloading the Android source code is to modify the file identifier limit:
Because Mac OS defaults to limit the number of file identifiers that are open at the same time, parallel compilation processing may exceed this limit. So add such a paragraph to the ~/.bash_profile:
# Set the number of open files to be 1024
Ulimit-s-N 1024
2. Download the source code:
To install git Repo:
$ mkdir ~/bin
$ Path=~/bin: $PATH
$ Curl Http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Initialize git repo to enter the mirrored hard disk that was mounted at the beginning, and create a working directory:
$CD/volumes/androiddisk
$makedir workingspace/
$CD Working space/
$ repo Init-u https://android.googlesource.com/platform/manifest
There may be errors when executing this file,
Question 1
However, during the repo initialization process, you encounter a problem
/root/bin/repo line 1:syntax error near unexpected token ' newline '
have been under the source code before, but have not encountered this problem
Tested and re-downloaded
$ Curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ repo Init-u https://android.googlesource.com/platform/manifest
$ repo Sync
Note that this is HTTPS, not http
When I started writing HTTP, it created the problem.
$ repo init-u https://android.googlesource.com/platform/manifest-b ANDROID-4.0.1_R1
Synchronizing files:
$ repo Sync
(start to download the repo file-source code.) So it seems that the time to sleep is up again. )
Then import a GPG public key,
$ GPG--import
The following is the official website to give the key, after entering the end of press Ctrl+d
Download Android source code under MAC step