zoukankan      html  css  js  c++  java
  • 编译Android源码中的单独模块

    一次完整的Android源码的编译过程耗时很久,慢点的机器可能需要数个小时甚至更多的时间。实际上Android源代码可以分模块单独编译。一次完全编译后,以后可以根据需要单独编译需要的模块,然后在重新打包成system.img 。

    模块编译需要的工具在Android源码目录下的build/envsetup.sh中,运行这个脚本可以初始化一些环境变量并提供一些额外的命令。

    $ source ./build/envsetup.sh

    提供的命令如下:

    - croot: Changes directory to the top of the tree.  #切换工作目录为android源码目录的顶层目录
    - m:       Makes from the top of the tree.  #从android源码树的顶部开始编译
    - 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.  #搜索出指定文件所在目录提供给用户来选择进入
    

    譬如可以使用mmm命令来编译Email模块:

    $ mmm packages/apps/Email/
    ....
    Install: out/target/product/generic/system/app/Email.apk
    ....
    Install: out/target/product/generic/data/app/EmailTests.apk
    

    编译生成的模块分别放到了out/target/product/generic/下的system/app和data/app下。这个路径可以通过设置环境变量ANDROID_PRODUCT_OUT 来改变。

    打包system.img的方法如下:

    $ make snod
    ...
    Install: out/host/linux-x86/bin/mkyaffs2image
    make snod: ignoring dependencies
    Target system fs image: out/target/product/generic/system.img
    

    这样就不需要每次都完全编译整个源码了。

    参考:

    http://blog.csdn.net/luoshengyang/article/details/6566662

  • 相关阅读:
    Title提示样式修改
    列表查询数据交互简写形式
    cookie 一次性弹窗
    postman 使用 设置
    idea window mac安装
    在线校验格式化工具
    bootstrap下拉列表多选组件
    kaiguan
    5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例
    对js里bind函数的理解
  • 原文地址:https://www.cnblogs.com/daemon369/p/3276508.html
Copyright © 2011-2022 走看看