Ubuntu系统建立Andriod编译环境

2023-11-05

本文来源:http://source.android.com/source/initializing.html

Initializing a Build Environment

The "Getting Started" section describes how to set up your local work environment, how to use Repo to get the Android files, and how to build the files on your machine. 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 6GB in size. You will need 25GB free to complete a single build, and up to 80GB (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.

Setting up a Linux build environment

The Android build is routinely tested in house on recent versions of Ubuntu LTS (10.04), but most distributions should have the required build tools available. Reports of successes or failures on other distributions are welcome.

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.

In general you will need:

  • Python 2.5 -- 2.7, which you can download from python.org.

  • JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.

  • Git 1.7 or newer. You can find it at git-scm.com.

Detailed instructions for Ubuntu 10.04+ follow.

Installing the JDK

The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.

Java 6: for Gingerbread and newer

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

Java 5: for Froyo and older

$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk

Installing required packages

64-bit (recommended)

$ 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

On Ubuntu 10.10:

$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

On Ubuntu 11.10:

$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so

32-bit (experimental)

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
  libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
  libxml2-utils

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. must be replaced by the actual username of the user who is authorized to access the phones over USB.

# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on maguro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"

Those new rules take effect the next time a device is plugged in. It might therefore be necessary to unplug the device and plug it back into the computer.

This is known to work on both Ubuntu Hardy Heron (8.04.x LTS) and Lucid Lynx (10.04.x LTS). Other versions of Ubuntu or other variants of GNU/linux might require different configurations.


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu系统建立Andriod编译环境 的相关文章

随机推荐

  • HTML5制作个人简历模板

    利用表格标签制作一个个人简历的模板 代码片段如下 table cellspacing 1 width 700px align center caption 个人简历 caption tr height 45 th 姓名 th td td t
  • 弱网测试及工具对比(Fiddler/Charles/NEWT/Clumsy/ATC/WANem/QNET)

    1 什么是弱网测试 弱网测试主要就是对带宽 丢包 延时等进行模拟弱网环境 衡量网络性能好坏的几个指标 带宽 吞吐量 单位时间内传输的数据量 单位通常是 每秒比特数 bps 带宽反映了网络的传输能力 越大越好 丢包 数据丢包个数 发送的数据包
  • MySQL中concat

    MySQL中使用concat拼接字符集 用mysql统计数据总和 需要拼接中文 发现是乱码 一直以为自己写的sql有问题 最后一查原来是因为使用concat函数时 需要转换参数类型 1 乱码sql 直接使用concat拼接中文和统计结果 s
  • 数据结构-多项式的基本操作(链表实现)

    include
  • 虚机Centos忘记密码如何重置 -- 小黑日常超细教学

    有时候虚机太多 会忘记有一些虚机的密码 当启动机器的时候那我们可以尝试重置虚机密码然后登录 日常的小技能记述 目录 一 演示虚机为centos7系列 二 进入开机前的页面 选中第一个 按 e 键 进入编辑模式 三 找到ro crashker
  • ALIGN_SIZE宏解释

    转载 http blog chinaunix net uid 27879959 id 3880459 html 0 tsina 1 63290 397232819ff9a47a7b7e80a40613cfe1
  • 会话固定攻击(session fixation attack)及解决办法

    1 Cookie 的工作过程 Cookie的传递用到了两个字段 请求头字段Cookie和响应头字段Set Cookie 当用户浏览器第一次访问服务器的时候 服务器肯定是不知道他的身份的 所以 就要创建一个独特的身份识别数据 格式是 key
  • 本地maven仓库有jar包但是pom却报错

    发生背景 电脑已经存在了一个项目 需要导入另外一个项目 将新项目的maven地址指向之前那个项目的maven仓库 出现mybatis spring boot在pom中报红 去找jar对应的文件夹 发现jar已存在 但是还是报错 解决 根据网
  • 数值分析:矩阵奇异值分解

    1 奇异值分解 SVD 1 奇异值分解 已知矩阵 bm A in R m times n 其奇异值分解为 bm A bm U bm S bm V T 其中 bm U in R m times m bm V in R n times n 是正
  • 第7章 数据库设计和ER模型

    第7章 数据库设计和ER模型 考试范围 7 1 7 7 考试题型 数据库设计题 考试内容 掌握基本ER模型的概念与ER图的设计 掌握将ER模型转换成关系模式的方法 1 掌握基本ER模型的概念与ER图的设计 概念 E R 模型是数据库设计中广
  • Lottie系列一:介绍与使用

    文章目录 一 Lottie 二 Lottie起源 社区 2 1起源 2 2 社区 2 3 Why Lottie 效率 还原度高 体积 研发的优势 2 4 When Lottie 2 5 Lottie不支持的效果 2 6 官方Demo和在线预
  • CPOW挖矿时代即将到来,你准备好了吗

    自2019年中本聪创建比特币以来 区块链已经经历了整整十年的发展历程 大家都知道 获取比特币的方式可以通过挖矿产出 这种通过硬件设备 消耗电能产出的模式被称为POW挖矿模式 这种模式最为简单 也是最常见的一种挖矿模式 绝大多数的数字货币都是
  • 台式计算机连接wifi适配器遇到问题,电脑提示无线适配器或访问点有问题的处理方法...

    我们在使用电脑过程中 多多少少都会遇到一些问题 比如 最近一位用户就反馈自己的电脑提示无线适配器或访问点有问题 导致网络无法正常连接 感觉十分烦恼 那么 该怎么办呢 接下来 就随系统城小编一起看看该问题的解决方法 方法如下 一 可能电脑的无
  • 基于云计算的Linux系统命令汇总

    用户管理 useradd 指定用户家目录 d 创建系统用户 r redhat 指定shell s 不创建家目录 M 权限管理 chmod 给用户添加权限 chmod 755 user chown 设置文件或目录的所有者和所属的组 只有文件主
  • 靶机三:CHRONOS_ 1

    一 靶机地址 https www vulnhub com entry chronos 1 735 二 信息收集 arpscan 发现主机地址 nmap信息收集 发现80 8000 22端口 可以访问到靶机页面 三 渗透阶段 burpsuit
  • 企业注册一个微信小程序都需要准备哪些物料

    企业注册一个微信小程序都需要提前准备哪些物料 准备资料 公司企业邮箱 企业资质信息 包括企业工商营业执照 组织机构代码证 非个体工商户 税务登记证 非个体工商户 法定代表人 负责人身份证明 法定代表人或负责人的有效身份证明 如身份证 护照等
  • ubuntu下ssh2安装

    iceant iceant desktop share ssh localhost ssh connect to host localhost port 22 Network is unreachable iceant iceant des
  • 清除APP 数据的时候出现Crash的情况分析

    在清除Chromium 浏览器数据的时候出现了异常情况 Crash 复制步骤 info gt Storage cache gt CLEAR STORAGE gt CLEAR ALL DATA gt OK Crash 关键log如下 5 25
  • 在家远程工作的体验和总结(为什么我决定更多的在家办公)

    在Parse ly公司 我们骄傲于有一个分布式的开发团队 我们的CTO Andrew 还写了一篇精彩的文章阐述为什么完全的分布式团队是可行的 我们三分之二的团队分步在美国 加拿大 欧洲等地 但我们在纽约也有一个 总部 这是我们的业务团队平时
  • Ubuntu系统建立Andriod编译环境

    本文来源 http source android com source initializing html Initializing a Build Environment The Getting Started section descr