google官方提供的编译android源码的环境初始化,Initializing a Build Environment

原文网址:http://source.android.com/source/initializing.html

Initializing a Build Environment

IN THIS DOCUMENT

  1. Choosing a Branch
  2. Setting up a Linux build environment
    1. Installing the JDK
    2. Installing required packages (Ubuntu 14.04)
    3. Installing required packages (Ubuntu 12.04)
    4. Installing required packages (Ubuntu 10.04 -- 11.10)
    5. Configuring USB Access
    6. Setting up ccache
    7. Using a separate output directory
  3. Setting up a Mac OS build environment
    1. Creating a case-sensitive disk image
    2. Installing the JDK
    3. Master branch
    4. Branch 5.0.x and earlier branches
    5. Branch 4.4.x and earlier branches
    6. Branch 4.0.x and all earlier branches
  4. Next: Download the source

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.

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 (14.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: See the Downloading and Building page for the list of hardware and software requirements. Then follow the detailed instructions for Ubuntu and Mac OS below.

Installing the JDK

The master branch of Android in the Android Open Source Project (AOSP) requires Java 7. On Ubuntu, useOpenJDK.

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 14.04)

You will need a 64-bit version of Ubuntu. Ubuntu 14.04 is recommended.

$ sudo apt-get install bison g++-multilib git gperf libxml2-utils

Installing required packages (Ubuntu 12.04)

You may use Ubuntu 12.04 to build older versions of Android. Version 12.04 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-glx: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 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 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
时间: 2024-10-20 17:19:39

google官方提供的编译android源码的环境初始化,Initializing a Build Environment的相关文章

Android介绍以及源码编译--编译Android源码

一. 编译Android源码 5.1     初始化环境变量 1 $ source build/envsetup.sh 2 $ . build/envsetup.sh 3 $ lunch full-eng 5.2     编译Android系统 1 $ make –jN 其中N参数代表你计算机的线程参数,数字越大,编译速度越快,但是要看你计算机支持到什么地步. 我使用的是 $ make –j8 经过几天的编译,终于看见胜利的曙光:system.img成功生成! 5.3     运行模拟器 编译成

【转】在Ubuntu下编译Android源码并运行Emulator

原文网址:http://www.mcuos.com/thread-4553-1-1.html 建立编译环境 1.在VirtualBox上安装Ubuntu 2.安装JDK   $ sudo apt-get install sun-java5-jdk  或   $ sudo apt-get install sun-java6-jdk (donut 1.6)3.安装flex,bison,gperf,libsdl-dev,libesd0-dev,libwxgtk2.6-dev(可选),build-ess

Ubuntu12.04编译Android4.0.1源码全过程-----附wubi安装ubuntu编译android源码硬盘空间不够的问题解决

本文转至  http://blog.csdn.net/yanzi1225627/article/details/9263097 昨晚在编译源码,make一段时间之后报错如下: [html] view plaincopyprint? # A fatal error has been detected by the Java Runtime Environment: # #  SIGSEGV (0xb) at pc=0x40362d33, pid=12195, tid=2835454784 # # 

编译Android源码

Android源码体积非常庞大,由Dalvik虚拟机.Linux内核.编译系统.框架代码.Android定制C库.测试套件.系统应用程序等部分组成,在编译Android源码之前,先掌握Android源码的组成. Android源码目录结构 在Android源码中,按照不同功能代码被放在不同的目录下: 目录 描述 bionic 针对Android系统定制的仿生标准C库.链接器等所在目录,Android系统并没有使用Linux的glibc库,bioinc C库针对嵌入式系统做了优化,添加了一些And

Docker环境下编译android源码|编译可运行xposed

前言 因为我的电脑是Ubuntu18的版本,成功编译xposed刷入手机之后无法启动,检查了所有的环境,没有问题,发现可能是Ubuntu系统的兼容库的问题,但是我不可能重新安装系统吧,毕竟有点蠢,所以最好的方式就是在docker的Ubuntu容器中编译,统一环境问题,也可以隔离环境平时 工作开发环境,下面开始操作 安装配置docker docker加速,采用对国人友好的镜像地址 通过修改daemon配置文件/etc/docker/daemon.json来使用加速器,执行以下命令: 您可以配置 D

【转】Ubuntu10.04上编译Android源码(Build Android source in Ubuntu10.04 Platform)

原文网址:http://blog.csdn.net/chenyafei617/article/details/6570928 一.Introduction 今天我们就来谈谈如何在Ubuntu平台上面编译android源码,我的是ubuntu10.04版本,在进行编译流程讲解之前我想讲一下 make .make snod .make kernel的作用,m.mm.mmm它们的作用以及区别. - make:                 编译源码,生成相应的系统镜像文件.             

Android介绍以及源码编译---Android源码下载

四. Android源码下载 4.1     安装repo 在home目录下建立bin文件夹 $ mkdir ~/bin $ PATH=~/bin:$PATH 安装并更改权限 $curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo 4.2     初始化repo 创建工作目录(存放源码) $ mkdir Android4.1 $ cd Android4.1

分享编译Android源码的全过程

通过参考网上的相关资料,我编译Android源码的步骤如下: 1 我的系统是Ubuntu 8.04 2 系统上必须安装以下工具(摘自网上的资料):  sudo apt-get install build-essential sudo apt-get install make  sudo apt-get install gcc  sudo apt-get install g++  sudo apt-get install libc6-dev  sudo apt-get install flex  

[原]编译Android源码过程中遇到的问题

编译Android源码的过程参考Android官网介绍: 1.下载Android源码的步骤:https://source.android.com/source/downloading.html 2.编译Android源码的步骤:https://source.android.com/source/building-running.html 下面就是我遇到的一些问题: 1.Compile Android Source时JDK相关的错误: 错误1: target release 1.5 conflic