`
ai_longyu
  • 浏览: 516612 次
社区版块
存档分类
最新评论

Android下载源码,编译等的官网说明网址

 
阅读更多

http://source.android.com/source/building.html

网上看了那么多的blog说明,终于找到原版了,哈哈!

原文转贴:

Building the System

The basic sequence of build commands is as follows:

Initialize

Initialize the environment with the envsetup.sh script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.

$ source build/envsetup.sh

or

$ . build/envsetup.sh

Choose a Target

Choose which target to build with lunch . The exact configuration can be passed as an argument, e.g.

$ lunch full-eng

The example above refers to a complete build for the emulator, with all debugging enabled.

If run with no arguments lunch will prompt you to choose a target from the menu.

All build targets take the form DEVICE-BUILDTYPE, where the DEVICE is a codename referring to the particular hardware:

Codename Device
passion Nexus One
crespo Nexus S
generic emulator

and the BUILDTYPE is one of the following:

Buildtype Use
user limited access; suited for production
userdebug like "user" but with su access; preferred for debugging
eng unrestricted access

Build the Code

Build everything with make . GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32 .

$ make -j4

Run It!

You can either run your build on an emulator or flash it on a device. Please note that you have already selected your build target with lunch , and it is unlikely at best to run on a different target than it was built for.

Flash a Device

To flash a device, you will need to use fastboot , which should be included in your path after a successful build. Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with

$ adb reboot bootloader

Once the device is in fastboot mode, run

$ fastboot flashall -w

The -w option wipes the /data partition on the device; this is useful for your first time flashing a particular device, but is otherwise unnecessary.

Emulate an Android Device

The emulator is added to your path automatically by the build process. To run the emulator, type

$ emulator

Troubleshooting Common Build Errors

Wrong Java Version

If you are attempting to build froyo or earlier with Java 1.6, or gingerbread or later with Java 1.5, make will abort with a message such as

************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: WRONG_VERSION.
The correct version is: RIGHT_VERSION.

Please follow the machine setup instructions at
http://source.android.com/download
************************************************************

This may be caused by

  • failing to install the correct JDK as specified on the Initializing page. Building Android requires Sun JDK 5 or 6 depending on which release you are building.

  • another JDK that you previously installed appearing in your path. You can remove the offending JDK from your path with:

    $ export PATH=${PATH///path//to//jdk//dir:/}

Python Version 3

Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:

$ apt-get install python

Gmake Version 3.82

There is a bug in make version 3.82 on Mac OS that prevents building Android.

TODO: what the error looks like with GNU make 3.82 on older builds that don't explicitly detect it.

Follow the instructions on the Initializing page for reverting GNU make from 3.82 to 3.81.

Case Insensitive Filesystem

If you are building on an HFS filesystem on Mac OS X, you may encounter an error such as

************************************************************
You are building on a case-insensitive filesystem.
Please move your source tree to a case-sensitive filesystem.
************************************************************

Please follow the instructions on the Initializing page for creating a case-sensitive disk image.

No USB Permission

On most Linux systems, unprivileged users cannot access USB ports by default. If you see a permission denied error, follow the instructions on the Initializing page for configuring USB access.

If adb was already running and cannot connect to the device after getting those rules set up, it can be killed with adb kill-server . That will cause adb to restart with the new configuration.

分享到:
评论

相关推荐

    android P android9源码编译.ipr.iml文件

    需要注意的是,编译Android源码可能需要大量的计算资源,包括内存和磁盘空间。此外,由于源码的复杂性,可能需要解决依赖问题、编译错误或配置问题。熟悉Android的构建系统,如`build.gradle`文件和`Android.mk`文件...

    android源码编译环境搭建方法说明

    **知识点详解:Android源码编译环境搭建方法** 在深入探讨如何搭建Android源码编译环境之前,我们首先需要理解为什么会有这样的需求。对于开发者而言,掌握如何从源码级别构建Android系统,不仅可以帮助他们更好地...

    android 源码的下载,及其编译步骤

    - Eclipse作为开发环境,可从官方网站下载最新版本。 - 下载并安装Android SDK,通过SDK Manager下载所需的SDK版本。注意,SDK的路径也应被添加到环境变量中,以便于后续操作。 3. **安装必要软件包** - 在Linux...

    Android交叉编译环境&Iperf3;.0源码编译

    本文将详细阐述如何在Linux环境下搭建Android交叉编译环境,并针对iperf3.0源码进行编译,以生成适用于Android系统的可执行文件。 首先,交叉编译是指在一个平台上构建另一个平台上的软件。对于Android,我们通常在...

    android源码上编译APK

    在Android源码上编译APK是一个复杂但必要的过程,特别是当你需要开发具有系统权限的应用,例如修改系统时间或实现关机功能。以下是对整个流程的详细解释: 首先,你需要编译Android源码。这通常涉及到获取源码、...

    Android 源码编译的jar包

    在Android开发中,源码编译的jar包是开发者深入理解系统运作、定制化系统或者进行二次开发的重要工具。本文将详细阐述如何编译Android源码以生成`classes.jar`,以及这个过程中的关键知识点。 首先,让我们了解`...

    Android Launcher 源码修改可编译.zip源码资源下载

    本文将深入探讨Android Launcher的源码结构、关键组件以及如何进行修改和编译。 首先,理解Android Launcher的源码结构是至关重要的。源码通常包括多个模块,如UI布局文件、Java代码、资源文件(如图片、字符串资源...

    Android4.0源码编译

    ### Android 4.0 源码编译详解 #### 一、编译环境搭建 在开始Android 4.0的源码编译之前,首先需要准备一个合适的编译环境。根据描述,本文档主要介绍如何在Ubuntu 10.04 LTS下进行Android 4.0源码的编译。 #####...

    android 9.0 源码下载(28 r6)

    首先,要下载Android源码,你需要一个Linux环境,因为官方的构建工具链和文档主要针对这个平台。Ubuntu是最常见的选择,但其他基于Debian的发行版也可以。确保你的系统安装了必要的依赖项,如Git、Repo、Java JDK...

    安卓Android源码——Android Launcher 源码修改可编译.zip

    3. **编译Android源码**:要编译Android源码,开发者需要搭建AOSP(Android Open Source Project)环境,安装必要的工具如Repo、JDK、NDK等,并执行make命令来构建系统。 4. **源码修改**:修改Android源码可能包括...

    Android源码编译.html

    Android源码编译

    Android 系统 8.1源码

    3. **下载源码**:使用git工具克隆或下载Android 8.1的源码。 4. **设置编译参数**:根据需求选择不同的编译目标,如`eng`(工程版)、`userdebug`(调试版)等。 5. **执行编译命令**:运行`lunch`命令来选择编译...

    Android源码的编译

    本文档将引导您完成在Ubuntu 8.10上搭建Android源码编译环境的过程。根据提供的部分文档,首先需要确保安装了必要的编译工具和依赖库。 **命令示例**: ```bash sudo apt-get install build-essential make gcc ...

    android2[1].3源码下载编译过程

    总的来说,编译Android源码是一个复杂的过程,需要耐心和一定的技术基础。通过这个过程,开发者不仅可以深入理解Android系统的工作机制,还可以自定义系统,实现特定功能,为个性化和优化提供可能。

    Android 源码编译过程

    Android源码编译过程是Android开发中的核心环节,它涉及到一系列复杂的步骤,旨在将源代码转化为可以在Android设备上运行的二进制系统映像。这个过程对于开发者来说至关重要,因为它允许自定义和优化Android系统,以...

    Android源码反编译工具包

    这个"Android源码反编译工具包"就是专为这种需求设计的,它包含了查看和分析Android应用源码所需的各种工具。下面将详细介绍这个工具包的关键组件和使用流程。 首先,反编译过程通常包括以下几个步骤: 1. **...

    Android Launcher 源码修改可编译.zip项目安卓应用源码下载

    Android Launcher 源码修改可编译.zip项目安卓应用源码下载Android Launcher 源码修改可编译.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考

    android源码下载编译

    以下是一个详细的指南,讲解如何在Ubuntu环境下搭建Android源码编译环境,下载Android 4.0.3(Ice Cream Sandwich,简称ICS)的源码,并进行编译。 1. **安装Ubuntu虚拟机**: - 首先,你需要在主机上安装一个支持...

    Ubuntu平台下Android2.3源码下载编译全过程

    同时,安装Java Development Kit (JDK) 1.6或更高版本,因为Android源码编译需要JDK支持。 接下来,为了下载和管理源码,你需要安装一些必备工具。首先,通过`sudo apt-get install git-core curl`命令安装`git-...

Global site tag (gtag.js) - Google Analytics