mmm -j4 snod framework/base
mp systemimage
使用模組編譯,只需要在你所在的模組的目錄或者其子目錄,執行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
編譯模組
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查看用法