Config the Android 5.0 Build Environment
In this document
Choosing a Branch
Setting up a Linux build environment
Installing the JDK
Installing required packages (Ubuntu 12.04)
Installing required packages (Ubuntu 14.04)
Installing required packages (Ubuntu 10.04 -- 11.10)
Configuring USB Access
This section describes how to set up your local work environment to build the Android source files. You will need to use Linux or Mac OS. Building under Windows is not currently supported.
Note: The source download is approximately 8.5GB in size. You will need over 30GB free to complete a single build, and up to 100GB (or more) for a full set of builds.
For an overview of the entire code-review and code-update process, see Life of a Patch.
Choosing a Branch
Some of the requirements for your build environment are determined by which version of the source code you plan to compile. See Build Numbers for a full listing of branches you may choose from. You may also choose to download and build the latest source code (called "master"), in which case you will simply omit the branch specification when you initialize the repository.
Once you have selected a branch, follow the appropriate instructions below to set up your build environment.
Setting up a Linux build environment
These instructions apply to all branches, including master.
The Android build is routinely tested in house on recent versions of Ubuntu LTS (12.04), but most distributions should have the required build tools available. Reports of successes or failures on other distributions are welcome.
For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required. Older versions can be compiled on 32-bit systems.
Note: It is also possible to build Android in a virtual machine. If you are running Linux in a virtual machine, you will need at least 16GB of RAM/swap and 30GB or more of disk space in order to build the Android tree.
See the Downloading and Building page for the list of hardware and software requirements. Then follow the detailed instructions for Ubuntu and MacOS below.
Installing the JDK
The master branch of Android in the Android Open Source Project (AOSP) requires Java 7. On Ubuntu, use OpenJDK.
Java 7: For the latest version of Android
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
Optionally, update the default Java version by running:
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
If you encounter version errors for Java, set its path as described in the Wrong Java Version section.
To develop older versions of Android, download and install the corresponding version of the Java JDK:
Java 6: for Gingerbread through KitKat
Java 5: for Cupcake through Froyo
Note: The lunch command in the build step will ensure that the Sun JDK is used instead of any previously installed JDK.
Installing required packages (Ubuntu 12.04)
You will need a 64-bit version of Ubuntu. Ubuntu 12.04 is recommended. Building using an older version of Ubuntu is not supported on master or recent releases.
$ sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dri:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Installing required packages (Ubuntu 14.04)
Building on Ubuntu 14.04 is experimental at the moment but will eventually become the recommended environment.
$ sudo apt-get install bison g++-multilib git gperf libxml2-utils
Installing required packages (Ubuntu 10.04 -- 11.10)
Building on Ubuntu 10.04-11.10 is no longer supported, but may be useful for building older releases of AOSP.
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
On Ubuntu 10.10:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10:
$ sudo apt-get install libx11-dev:i386
Configuring USB Access
Under GNU/linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access.
The recommended approach is to create a file /etc/udev/rules.d/51-android.rules (as the root user) and to copy the following lines in it. <username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
Config the Android 5.0 Build Environment的更多相关文章
- Android Initializing a Build Environment
from://https://source.android.com/source/initializing.html#next-download-the-source Initializing a B ...
- google官方提供的编译android源码的环境初始化,Initializing a Build Environment
原文网址:http://source.android.com/source/initializing.html Initializing a Build Environment IN THIS DOC ...
- Android 4.0源码目录结构
转:http://blog.csdn.net/xiangjai/article/details/9012387 在学习Android的过程中,学习写应用还好,一开始不用管太多代码,直接调用函数就可以了 ...
- Initializing a Build Environment
This section describes how to set up your local work environment to build the Android source files. ...
- Android 4.0 ProGuard 代码混淆 以及 proguard returned with error code 1.See console异常的解决方法
最近呢说要上线,就去找了下上线的方法...之前做过代码混淆,用的是progarud.cfg,但是呢自己反编译了之后还是无效,然后就丢着先不管了,因为实在不知道什么情况.今天来上线的时候结果总是报错,总 ...
- Android 5.0之后屏幕截图的方法
截图的几种方法 Android获取屏幕截图主要有以下三种方法 1.通过view.getDrawingCache()获取指定View的绘制缓存来实现截屏. 这种方式Android 5.0之前也可以,且不 ...
- android 7.0 多渠道打包 - 美团开源工具Walle 命令行打包
在Android 7.0(Nougat)推出了新的应用签名方案APK Signature Scheme v2后,之前快速生成渠道包的方式(美团Android自动化之旅-生成渠道包)已经行不通了,对此美 ...
- Ubantu16.04进行Android 8.0源码编译
参考这篇博客 经过测试,8.0源码下载及编译之后,占用100多G的硬盘空间,尽量给ubantu系统多留一些硬盘空间,如果后续需要在编译好的源码上进行开发,需要预留更多的控件,为了防止后续出现文件权限问 ...
- Android开发之深入理解Android 7.0系统权限更改相关文档
http://www.cnblogs.com/dazhao/p/6547811.html 摘要: Android 6.0之后的版本增加了运行时权限,应用程序在执行每个需要系统权限的功能时,需要添加权限 ...
随机推荐
- 1220. Stacks
1220 又一神题啊 卡内存可以卡到这种地步 省得不行了 开两个[N]数组 一个来记录前驱 一个存数 记录前驱的用unsigned short类型 最大可达65535 不过可以标记一下是否比这个数 ...
- struts2的action中获得request response session 对象
在struts2中有两种方式可以得到这些对象 1.非IoC方式 要获得上述对象,关键Struts 2中com.opensymphony.xwork2.ActionContext类.我们可以通过它的静态 ...
- 逻辑回归损失函数(cost function)
逻辑回归模型预估的是样本属于某个分类的概率,其损失函数(Cost Function)可以像线型回归那样,以均方差来表示:也可以用对数.概率等方法.损失函数本质上是衡量”模型预估值“到“实际值”的距离, ...
- 【转】特斯拉CEO马斯克:关于创业的几件重要事情
特斯拉电动汽车联合创始人兼CEO,私人太空发射公司SpaceX CEO伊隆马斯克(Elon Musk)于5月16日在南加大商学院毕业典礼上发表演讲,他谈到了关于创业的几件重要的事情:一是努力工作;二是 ...
- mkimage工具 加载地址和入口地址 内核启动分析
第三章第二节 mkimage工具制作Linux内核的压缩镜像文件,需要使用到mkimage工具.mkimage这个工具位于u-boot-2013. 04中的tools目录下,它可以用来制作不压缩或者压 ...
- 一个可能是pip的一个BUG
今天重新安装了Python,把Python的安装位置改为 D:\Program Files\Python\Python34\ 用pip 安装 Django 的时候出现一下错误 >pip inst ...
- HDU 4237 The Rascal Triangle
The Rascal Triangle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- 如何使用spring中的Log4jConfigListener--删除
使用spring中的Log4jConfigListener有如如下好处: 1. 动态的改变记录级别和策略,不需要重启Web应用,如<Effective Enterprise Java> ...
- HDU 1075-What Are You Talking About(Trie)
题意: 给你一个字典 一个英文单词对应一个火星单词 给你一段火星文翻译成英文 字典上的没有的不翻译 分析: 没有给数据规模 字典树用链表 #include <map> #include & ...
- setup.s
INITSEG = 0x9000 ! we move boot here - out of the way ! 原来 bootsect 所处的段. ! ok, the read went well s ...