i.mx6 Android5.1.1 build解析
参考资料:理解 Android Build 系统
把总结放前面:
1. 常用编译命令
| make clean | 执行清理,等同于:rm -rf out/。 |
| make sdk | 编译出 Android 的 SDK。 |
| make clean-sdk | 清理 SDK 的编译产物。 |
| make update-api | 更新 API。在 framework API 改动之后,需要首先执行该命令来更新 API,公开的 API 记录在 frameworks/base/api 目录下。 |
| make dist | 执行 Build,并将 MAKECMDGOALS 变量定义的输出文件拷贝到 /out/dist 目录。 |
| make all | 编译所有内容,不管当前产品的定义中是否会包含。 |
| make help | 帮助信息,显示主要的 make 目标。 |
| make snod | 从已经编译出的包快速重建系统镜像。 |
| make libandroid_runtime | 编译所有 JNI framework 内容。 |
| make framework | 编译所有 Java framework 内容。 |
| make services | 编译系统服务和相关内容。 |
| make <local_target> | 编译一个指定的模块,local_target 为模块的名称。 |
| make clean-<local_target> | 清理一个指定模块的编译结果。 |
| make dump-products | 显示所有产品的编译配置信息,例如:产品名,产品支持的地区语言,产品中会包含的模块等信息。 |
| make PRODUCT-xxx-yyy | 编译某个指定的产品。 |
| make bootimage | 生成 boot.img |
| make recoveryimage | 生成 recovery.img |
| make userdataimage | 生成 userdata.img |
| make cacheimage | 生成 cache.img |
2.常用命令:
| 名称 | 说明 |
|---|---|
| croot | 切换到源码树的根目录 |
| m | 在源码树的根目录执行 make |
| mm | Build 当前目录下的模块 |
| mmm | Build 指定目录下的模块 |
| cgrep | 在所有 C/C++ 文件上执行 grep |
| jgrep | 在所有 Java 文件上执行 grep |
| resgrep | 在所有 res/*.xml 文件上执行 grep |
| godir | 转到包含某个文件的目录路径 |
| printconfig | 显示当前 Build 的配置信息 |
| add_lunch_combo | 在 lunch 函数的菜单中添加一个条目 |
我们正常步骤为:
1). source build/envsetup.sh
2). lunch
3). make -jx
build/envsetup.sh
打开build/envsetup.sh,发现里面全都是函数,折叠全部函数,一直拖到最后,发现代码
if [ "x$SHELL" != "x/bin/bash" ]; then
case `ps -o command -p $$` in
*bash*)
;;
*)
echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
;;
esac
fi # Execute the contents of any vendorsetup.sh files we can find.
#包含各种vendorsetup.s脚本文件进来,然后去执行 for f in `test -d device && find -L device -maxdepth -name 'vendorsetup.sh' > /dev/null` \
`test -d vendor && find -L vendor -maxdepth -name 'vendorsetup.sh' > /dev/null`
do
echo "including $f"
. $f
done
unset f addcompletions

查看发现没错,查看lunch
function lunch()
{
local answer
#如果有第一个参数
if [ "$1" ] ; then
answer=$
else #如果没有参数,就进入print_lunch_menu函数
print_lunch_menu
echo -n "Which would you like? [aosp_arm-eng] "
read answer
fi local selection= if [ -z "$answer" ]
then
selection=aosp_arm-eng
elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$")
then
if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
then
selection=${LUNCH_MENU_CHOICES[$(($answer-))]}
fi
elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
then
selection=$answer
fi if [ -z "$selection" ]
then
echo
echo "Invalid lunch combo: $answer"
return
fi export TARGET_BUILD_APPS= local product=$(echo -n $selection | sed -e "s/-.*$//")
check_product $product
if [ $? -ne ]
then
echo
echo "** Don't have a product spec for: '$product'"
echo "** Do you have the right repo manifest?"
product=
fi local variant=$(echo -n $selection | sed -e "s/^[^\-]*-//")
check_variant $variant
if [ $? -ne ]
then
echo
echo "** Invalid variant: '$variant'"
echo "** Must be one of ${VARIANT_CHOICES[@]}"
variant=
fi if [ -z "$product" -o -z "$variant" ]
then
echo
return
fi
#到处环境变量
export TARGET_PRODUCT=$product
export TARGET_BUILD_VARIANT=$variant
export TARGET_BUILD_TYPE=release echo set_stuff_for_environment
printconfig
}
function hmm() {
cat <<EOF
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch: lunch <product_name>-<build_variant>
- tapas: tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]
- croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory, but not their dependencies.
- mmm: Builds all of the modules in the supplied directories, but not their dependencies.
To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma: Builds all of the modules in the current directory, and their dependencies.
- mmma: Builds all of the modules in the supplied directories, and their dependencies.
- cgrep: Greps on all local C/C++ files.
- ggrep: Greps on all local Gradle files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- sgrep: Greps on all local source files.
- godir: Go to the directory containing a file.
Look at the source to view more functions. The complete list is:
EOF
T=$(gettop)
local A
A=""
for i in `cat $T/build/envsetup.sh | sed -n "/^[ \t]*function /s/function \([a-z_]*\).*/\/p" | sort | uniq`; do
A="$A $i"
done
echo $A
}
i.mx6 Android5.1.1 build解析的更多相关文章
- i.mx6 Android5.1.1 初始化流程之init.rc解析(未完成)
接上一篇:i.mx6 Android5.1.1 初始化流程之init进程 参考资料:http://blog.csdn.net/mr_raptor/article/category/799879 这个博 ...
- i.mx6 Android5.1.1 System server
1. 概述: 1. Zygote进程是Android Java世界的开创者,所有的Java应用程序进程都由Zygote进程创建: 2. Zygote创建应用程序进程过程其实就是复制自身进程地址空间作为 ...
- i.mx6 Android5.1.1 初始化流程之框架
Android启动过程分为以下几个步骤: 1. Boot ROM: 上电后启动芯片固话代码. 2. BootLoader:固话代码会根据启动模式启动bootloader,(一般为启动引脚的电平的 ...
- i.mx6 Android5.1.1 初始化流程之init进程(未完成)
概述: 接在i.mx6 Android5.1.1 初始化流程之框架之后 参考资料:http://blog.csdn.net/mr_raptor/article/category/799879 相关源码 ...
- i.mx6 Android5.1.1 servicemanager本地服务
接在之前的 i.mx6 Android5.1.1 初始化流程之init进程 i.mx6 Android5.1.1 初始化流程之init.rc解析 servicemanager是由init创建的本地服务 ...
- I.MX6 Linux U-boot 环境变量解析
/********************************************************************************** * I.MX6 Linux U- ...
- Android5.x Notification应用解析
Notification可以让我们在获得消息的时候,在状态栏,锁屏界面来显示相应的信息,很难想象如果没有Notification,那我们的qq和微信以及其他应用没法主动通知我们,我们就需要时时的看手机 ...
- i.mx6 Android5.1.1 系统属性
属性变更的请求时init事件循环处理的另一个事件,在Android平台中,为了让运行中的所有进程共享系统运行时所需要的各种设置值,系统开辟了属性存储区域,并提供了访问该区域的API.属性由键(key) ...
- i.mx6 Android5.1.1 Zygote
0. 总结: 0.1 相关源码目录: framework/base/cmds/app_process/app_main.cppframeworks/base/core/jni/AndroidRunti ...
随机推荐
- Redis键迁移
Redis键迁移 在使用Redis的过程中,很多时候我们会遇到需要进行键迁移的问题,需要将指定Redis中的指定数据迁移到其他Redis当中,键迁移有三种方法,我们来进行一一介绍. 一.move ...
- ES6 学习笔记之四 对象的扩展
ES6 为对象字面量添加了几个实用的功能,虽然这几个新功能基本上都是语法糖,但确实方便. 一.属性的简洁表示法 当定义一个对象时,允许直接写入一个变量,作为对象的属性,变量名就是属性名. 例1: , ...
- DBCC--SHOWCONTIG
DBCC SHOWCONTIG是显示指定的表的数据和索引的碎片信息. Usage: dbcc SHOWCONTIG [ ( { 'table_name' | table_id | 'view_name ...
- Windows Server 2012 R2部署--安装桌面体验
Windows Server 2012 R2部署(3)---安装桌面体验 1) 打开服务器管理器 2) 选择所有服务器 3)添加角色和功能 4)下一步 5)下一步 6)下一步 ...
- Unity/C#基础复习(3) 之 String与StringBuilder的关系
参考资料 [1] @毛星云[<Effective C#>提炼总结] https://zhuanlan.zhihu.com/p/24553860 [2] <C# 捷径教程> [3 ...
- C#委托总结-匿名方法&Lambda表达式
1,匿名方法 匿名方法可以在声明委托变量时初始化表达式,语法如下 之前写过这么一段代码: delegate void MyDel(string value); class Program { void ...
- DataSet转换成List<>
方法一: //DataSet转换成List<ArticleInfo> public List<ArticleInfo> GetArticleList(DataSet ds) { ...
- 初识GitHub与Git
在初次接触GitHub的时候,英语渣渣本渣真是深感无奈啊..... ORZ 在好友的帮助下,也算是初步入门了吧. 谨以此文作为初级使用手册记录,希望能帮助到你. 一.首先要申请一个GitHub账户 二 ...
- Hello World! 我的程序员入坑之旅!
先说下本文标题,各行各业都有自己的行规和一些内行人玩的梗什么的,这是我开始写技术博客的第一篇,所以它的标题毫无疑问只能是Hello World! 介绍一下我自己 我算是一个少见的科班出身的开发者了,1 ...
- Godot开发环境与学习资源
记得第一次听到Godot的名字时还在深圳工作,刚刚接触Unity快一年,只是匆匆在Github上star了,就没有继续了.后面时不时翻开它的Git主页,然而一直没有下载过,每每想看看开源引擎都去看Or ...