Android源码编译的琐碎笔记
2013-08-30 07:01
495 查看
全部编译:
1.初始化
source build/envsetup.sh (source 就是point符号,可以替换为”. “,比如. build/envsetup.sh)
这样就可以多出一些命令供我们使用:
- 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.
- mmm: Builds all of the modules in the supplied directories.
- cgrep: Greps on all local C/C++ files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir: Go to the directory containing a file.
2.选择一个目标
lunch full-eng
3.编译
make –j16
局部编译
有时我们对源代码做了修改以后,并不想全部编译源码,这样相当费时。如果能对修改的编译,然后直接烧写就好了。下面举几个例子:
1. Kernel
这个一直使用公司写的脚本,个人还没有详细研究。
2. Framework
使用mm 命令,步骤参考app。例如可以编译成framework.jar,而c++的一些比如mtp可以编出libmtp.so。
3. App
类似于编译framework,只是路径不同而已。举个编译mediaprovider的例子:
cd packages/providers/MediaProvider
mm -B
#need root and mount
adb shell
mount -o remount rw /system
chmod 777system/app
exit
adb push MediaProvider.apk /system/app
adb reboot
后记1
查看Android源码版本
build\core\version_defaults.mk
文件中搜索PLATFORM_VERSION
比如:4.4.1
1.初始化
source build/envsetup.sh (source 就是point符号,可以替换为”. “,比如. build/envsetup.sh)
这样就可以多出一些命令供我们使用:
- 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.
- mmm: Builds all of the modules in the supplied directories.
- cgrep: Greps on all local C/C++ files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir: Go to the directory containing a file.
2.选择一个目标
lunch full-eng
3.编译
make –j16
局部编译
有时我们对源代码做了修改以后,并不想全部编译源码,这样相当费时。如果能对修改的编译,然后直接烧写就好了。下面举几个例子:
1. Kernel
这个一直使用公司写的脚本,个人还没有详细研究。
2. Framework
使用mm 命令,步骤参考app。例如可以编译成framework.jar,而c++的一些比如mtp可以编出libmtp.so。
3. App
类似于编译framework,只是路径不同而已。举个编译mediaprovider的例子:
cd packages/providers/MediaProvider
mm -B
#need root and mount
adb shell
mount -o remount rw /system
chmod 777system/app
exit
adb push MediaProvider.apk /system/app
adb reboot
后记1
查看Android源码版本
build\core\version_defaults.mk
文件中搜索PLATFORM_VERSION
比如:4.4.1
相关文章推荐
- Android 4.0.1源码编译错误记录笔记
- 11、ffmpeg学习笔记—ffmpeg源码编译-Android
- Android源码编译笔记
- [笔记]Android 源码编译
- Android6.0/CM13源码编译笔记(一)
- Android Cupcake源码编译笔记
- Android环境建立之编译Android内核源码笔记---2
- android 学习笔记三(android 源码编译)
- Android 开发笔记 3:Android 系统源码下载与编译
- 学习笔记五:Ubuntu下载编译Android源码
- ubuntu 编译android 源码笔记
- Android环境建立之编译Android内核源码笔记---2
- 源码编译基于Android平台的XBMC笔记
- Android Cupcake源码编译笔记
- Android ADB 命令及源码编译命令笔记
- 【Orange Pi PC试用体验】11编译android源码笔记
- Linux—android源码编译问题
- 在Unix系统下编译Opencv源码生成android so库以及android-sdk
- Android 源码编译 make sdk ADT