生活随笔
收集整理的這篇文章主要介紹了
利用mm命令编译Android模块
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在Android開發過程中,當我們只需要編譯某個修改過的模塊時,使用mm命令可以使你不用編譯整個Android項目,而只需單獨編譯該模塊即可,這樣速度是不是很快呢?具體的步驟如下:
1. 在Android源代碼目錄下:
[c-sharp]?view plaincopy
cd?mydroid?? source?build/envsetup.sh??
也可以將source ~/mydroid/build/envsetup.sh放到~/.bashrc中,這樣每次打開shell時就會自動運行該腳本。
2. 在shell中使用help命令查看可以運行的命令
[c-sharp]?view plaincopy
#?help?? Invoke?".?build/envsetup.sh"?from?your?shell?to?add?the?following?functions?to?your?environment:?? -?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.?? ?? Look?at?the?source?to?view?more?functions.?The?complete?list?is:?? add_lunch_combo?cgrep?check_product?check_variant?choosecombo?chooseproduct?choosetype?choosevariant?cproj?croot?findmakefile?gdbclient?get_abs_build_var?getbugreports?get_build_var?getprebuilt?gettop?godir?help?isviewserverstarted?jgrep?lunch?m?mm?mmm?pid?printconfig?print_lunch_menu?resgrep?runhat?runtest?set_java_home?setpaths?set_sequence_number?set_stuff_for_environment?settitle?smoketest?startviewserver?stopviewserver?systemstack?tapas?tracedmdump??
可以看到mm命令,意思是編譯當前文件夾下的所有模塊。
3. 接下來的事情將變得很簡單,只需來到需要編譯的模塊文件夾下,運行mm命令即可,當然我們也可以用mmm命令,如mmm external/jpeg/,和在external/jpeg/目錄下運行mm命令具有同樣的效果。
總結
以上是生活随笔為你收集整理的利用mm命令编译Android模块的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。