利用mm命令編譯Android模組 .

來源:互聯網
上載者:User
轉載:http://blog.csdn.net/kellycan/article/details/6457030

 

 

在Android開發過程中,當我們只需要編譯某個修改過的模組時,使用mm命令可以使你不用編譯整個Android項目,而只需單獨編譯該模組即可,這樣速度是不是很快呢?具體的步驟如下:

1. 在Android原始碼目錄下:

[c-sharp]
view plaincopyprint?
  1. cd mydroid  
  2. source build/envsetup.sh  

cd mydroid<br /> source build/envsetup.sh

也可以將source ~/mydroid/build/envsetup.sh放到~/.bashrc中,這樣每次開啟shell時就會自動運行該指令碼。

2. 在shell中使用help命令查看可以啟動並執行命令

[c-sharp]
view plaincopyprint?
  1. # help   
  2. Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:  
  3. - croot:   Changes directory to the top of the tree.  
  4. - m:       Makes from the top of the tree.  
  5. - mm:      Builds all of the modules in the current directory.  
  6. - mmm:     Builds all of the modules in the supplied directories.  
  7. - cgrep:   Greps on all local C/C++ files.  
  8. - jgrep:   Greps on all local Java files.  
  9. - resgrep: Greps on all local res/*.xml files.  
  10. - godir:   Go to the directory containing a file.  
  11.   
  12. Look at the source to view more functions. The complete list is:  
  13. 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  

# help<br />Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:<br />- croot: Changes directory to the top of the tree.<br />- m: Makes from the top of the tree.<br />- mm: Builds all of the modules in the current directory.<br />- mmm: Builds all of the modules in the supplied directories.<br />- cgrep: Greps on all local C/C++ files.<br />- jgrep: Greps on all local Java files.<br />- resgrep: Greps on all local res/*.xml files.<br />- godir: Go to the directory containing a file.</p><p>Look at the source to view more functions. The complete list is:<br />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命令具有同樣的效果。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.