编译Android源代码
硬盘空间需要在50G以上,最好100g
系统:ubuntu14.04
交叉工具链:arm-linux-gcc-4.5.1-v6-vfp-20120301
安装 Java 开发环境
$ sudo apt-get install openjdk--jdk openjdk--jre
首先准备android-5.0.2-fs-20150325.tar.gz 文件
解压
$ tar xzf android-5.0.-fs-.tar.gz
在 Ubuntu 下的解压内核并编译,命令为:
$ tar xzf linux-3.0.-.tgz
$ cd linux-3.0./
$ cp tiny4412_android_defconfig .config
$ make zImage
产生zImage文件在/arch/arm/boot目录下
编译 Android 系统
进入上述解压得到的 android-5.0.2, 执行以下命令(注意: “.”号后有一个空格):
$ . setenv
再执行“lunch”命令, 输入“full_tiny4412-eng”前的数字标号, 如下所示:
$ lunch
You're building on Linux
Lunch menu... pick a combo:
. aosp_arm-eng
. aosp_arm64-eng
. aosp_mips-eng
. aosp_mips64-eng
. aosp_x86-eng
. aosp_x86_64-eng
. full_tiny4412-userdebug
. full_tiny4412-eng
. aosp_mako-userdebug
. aosp_hammerhead-userdebug
. aosp_tilapia-userdebug
. aosp_grouper-userdebug
. aosp_deb-userdebug
. full_fugu-userdebug
. aosp_fugu-userdebug
. aosp_flo-userdebug
. aosp_shamu-userdebug
. aosp_manta-userdebug
. mini_emulator_mips-userdebug
. mini_emulator_x86_64-userdebug
. mini_emulator_arm64-userdebug
. m_e_arm-userdebug
. mini_emulator_x86-userdebug
Which would you like? [aosp_arm-eng]
接着执行“make”命令开始编译,也可以在 make 后加上“-j”参数利用 CPU 的多核加快编译
速度,比如在 4 核 CPU 上可以执行“make –j4”。
注意: 编译过程可能持续 4、 5 个小时。
最后,执行以下命令生成映象文件:
$./gen-img.sh
注意: 如果提示如下错误,要先编译 u-boot 以得到 mkimage 工具, 方法见后。
./gen-img.sh: line 31: mkimage: command not found
编译 u-boot 以得到 mkimage 工具的方法:
$ tar xzf uboot_tiny4412-.tgz
$ cd uboot_tiny4412/
$ make tiny4412_config
$ make
$ sudo cp tools/mkimage /usr/bin/
uboot_tiny4412-20130729.tgz在uboot工具中 最终在android-5.0.2目录下产生 android studio工程索引文件 android.ipr android.iml
系统镜像文件 system.img ramdisk-u.img userdata.img userdata-4g.img userdata-8g.img userdata-16g.img
编译Android源代码的更多相关文章
- [转]编译Android源代码常见错误解决办法
1. 编译时出现/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when ...
- 【转】如何单独编译Android源代码中的模块--不错
原文网址:http://blog.csdn.net//article/details/6566662/ 第一次下载好Android源代码工程后,我们通常是在Android源代码工程目录下执行make命 ...
- 如何单独编译Android源代码中的模块
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6566662 第一次下载好Android源代码工 ...
- 编译Android源代码与内核总结
这些天花了些时间自己下载了android源代码来编译,当中走了一些弯路导致耗了些时间,如今又一次梳理总结下,让有同样想法的人自己编译的时候能少走些弯路,官方指导文档在http://source.and ...
- 【Android 系统开发】下载 编译 Android源代码 和 Android kernel源代码
下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...
- 下载 编译 Android源代码 和 Android kernel源代码
下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...
- Ubuntu 下编译Android 源代码
1.配置JDK 1.6 或者1.7(看情况配置,有的Android版本不能在1.7下运行) 2.配置环境:终端:(CTRL+ALT+T) $ sudo apt-get install git gnup ...
- Android源代码编译过程及指令
编译Android源代码分为两种情况: 1. 完整编译源码: ./mk_aliphone.sh --> 完整编译脚本 --> 6735 输入对应的编号 --> userdebug ...
- 在mac os下编译android -相关文章
1. Mac OS X下编译Android源码 http://blog.csdn.net/bulreed/article/details/22783467 2.MAC OS 编译 Android源代码 ...
随机推荐
- Guava 开源工具的简单介绍
Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libra ...
- PascalCase & camelCase & kebabCase
帕斯卡拼写法( 也叫大骆驼拼写法),一种计算机编程中的变量命名方法.它主要的特点是将描述变量作用所有单词的首字母大写,然后直接连接起来,单词之间没有连接符.比如: Age LastName Winte ...
- Linux 核心编译与管理
一般情况下,不需要重新编译核心,除非以下特有的用途 [root@localhost ~]# wget ftp://ftp.twaren.net/pub/Unix/Kernel/linux/kernel ...
- Codeforces 354C 暴力 数论
题意:给你一个数组,你可以把数组中的数减少最多k,问数组中的所有数的GCD最大是多少? 思路:容易发现,GCD的上限是数组中最小的那个数,而因为最多可以减少k,及可以凑出来的余数最大是k,那么GCD的 ...
- springboot解决跨域
@Configuration public class WebMvcConfiguration implements WebMvcConfigurer { @Bean public CorsFilte ...
- Python的return语句中使用条件判断
if end1 <= val <= end2 or end2 <= val <= end1: return True else: return False 等于 return ...
- 【leetcode】940. Distinct Subsequences II
题目如下: Given a string S, count the number of distinct, non-empty subsequences of S . Since the result ...
- 【leetcode】976. Largest Perimeter Triangle
题目如下: Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero ...
- epoll学习(二)
首先看程序一,这个程序想要实现的功能是当用户从控制台有任何输入操作时,输出”hello world!”. l 程序一 #include <unistd.h> #include <io ...
- sed编辑器基础
一. 更多的替换选项 ①替换标记 root@localhost sed]# cat data4.txt This is a test of the test script. This is the s ...