Android 5.0 (Lollipop) source build environment (Mac OS X)

Source: Internet
Author: User
Tags intel core i5

Hardware environment: MacBook Pro Retina, 13-inch, late 2013

    Processor 2.4 GHz Intel Core i5

    Memory 8 GB DDR3 MHz

Hard disk 60G or more

Software Environment: OS X 10.9.2

    GNU make 3.81

Python 2.7.5

XCode 5.0.2

Java Version "1.7.0_55"

Repo VERSION = (1, 21)

A fee VPN (agent fan wall is not download, please use VPN)

( software version issues are likely to cause download or compile failures!!!) Please drop these versions to the high version ... )

1. Create a mirror. because the source code can only be compiled on the case sensitive disk (the red font indicates the parameters that can be configured by itself, the same as below)

Hdiutil create-type sparse-fs ' case-sensitive journaled hfs+ '-size 60g ~/android.dmg.sparsefile

This is a 60G hard drive.

2. Loading partitions

Hdiutil Attach ~/android.dmg.sparsefile -mountpoint /volumes/android

3. Download the appropriate tool

Mainly say repo, please open VPN

$ Curl Https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Then add the path of the repo to the environment variable for easy use later

Java, make and other tools please Google, try to use the same software version with the blogger.

4. modifying file descriptor Limits

In ~/.bash_profile, add the following:

# Set the number of open files to be 1024

Ulimit-s-N 1024

5. Go to the loaded partition (Above the/volumes/android)

CD /volumes/android/

mkdir Android-source

CD Android-source

6. Start the download

Repo Init-u https://android.googlesource.com/platform/manifest-b ANDROID-5.0.0_R3

If Init is normal, execute

Repo Sync or repo sync-j4

(Android-5.0.0_r3 is the Nexus 5 source code, other devices such as Nexus 9 or Nexus Player please refer to https://source.android.com/source/build-numbers.html)

A picture of the drawings

7. Start compiling

Executed under the android-source directory

Make

Then you can wait for the compilation to complete.

Blogger compilation encountered a problem in 5 hours and 50 minutes

The solution is to/volumes/android/external/iptables/include/linux/netfilter_ipv4/ipt_ecn.h the

#include <linux/netfilter/xt_DSCP.h>

Change into

#include <linux/netfilter/xt_dscp.h>

Summarize some of the problems encountered in the process

Version 1.repo. Unofficial repo tools may have secret key issues or download failures, please use the official version. The landlord with the old version of the repo for a long time, and later all deleted the new ...

2.VPN is unstable. This question does not explain many people all understand, LZ also did not buy more expensive line VPN. There is one solution, you can use Apple script to write a VPN automatic re-connect script, saved into the app. Please google for your own method. But occasionally there will be broken nets but the VPN is not broken, you can only manually re-connect.

3. The download and compilation time is too long. Download no statistics, estimates are not repo problem of that time, also more than 24 hours. Dalvik completely converted to art and added 5,000 APIs, compiling time significantly longer and compiling the total by 7 hours and 30 minutes. SOURCE 13.4g,repo file 20G, compiled the source +build out of the file a total of 43G.

4. Thanks to the official documentation: http://source.android.com/source/downloading.html

Thank someone for their article: http://blog.csdn.net/bulreed/article/details/22783467

The last two pictures:

Android 5.0 (Lollipop) source build environment (Mac OS X)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.