閱讀78 返回首頁    go 阿裏雲 go 技術社區[雲棲]


android模塊編譯,mm命令, 模塊編譯

from https://jinguo.javaeye.com/blog/691507  

如果你隻修改某一個模塊的內容,卻每次都要執行make, 最後等待很長時間。
使用模塊編譯,隻需要在你所在的模塊的目錄或者其子目錄,執行mm,便可以編譯出一個單獨的apk,這樣豈不快哉!
具體步驟:
        1)打開~/.baserc文件,加入source ~/I850/build/envsetup.sh. 加入你自己該文件所在的路徑,這樣就免去了每次啟動新的終端執行mm命令之前,需要引用此文件。
        2)完成步驟1之後,就可以在你的模塊裏麵隨意執行mm了,要想使用其他快速命令,可以查看envsetup.sh文件,比如 cgrep,jgrep,resgrep在不同類型的文件裏麵進行相應的查詢。還有m,mmm等等
        3)還可以使用adb push 將你的apk push到模擬器或者手機終端,也可以在工程根目錄通過make -snod生成新的system.img

 

 

 from https://mcuos.com/redirect.php?tid=4553&goto=lastpost

編譯模塊

Android中的一個應用程序可以單獨編譯,編譯後需要重新生成system.img。
在Android目錄下運行
$ . build/envsetup.sh  或者
$ source 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.
- printconfig: 當前build的配置情況.
可以使用 --help查看用法。
如:在修改了某一個模塊以後,可以使用 $ mmm <目錄>  來重新編譯所有在<目錄>中的所有模塊,使用 $ mm  編譯當前目錄中的所有模塊。
編完之後,即修改了Android係統以後,可以使用 $ make snod 重新生成system.img

最後更新:2017-04-02 00:06:51

  上一篇:go android ListView幾個比較特別的屬性
  下一篇:go 《江南Style》騎著社交網絡之馬