Android常用的一些make命令(轉載)--不錯

來源:互聯網
上載者:User

標籤:

原文網址:http://blog.sina.com.cn/s/blog_abc7e49a01011y0n.html

1.make -jXX
  XX表示數字,這個命令將編譯Android系統並產生鏡像,XX表示可以使用到的CPU核心數,這在配置好的電腦上特別有用,公司的16核ubuntu伺服器執行make -j16隻要不到20分鐘,而雙核PC上需要4個小時!

2.make snod
  
這條命令將重建鏡像,消耗的時間很少,類似WinCE的makeimg過程,如果你修改了一些資料檔案(如音樂、視頻)等檔案時比較有用。

3.make cts
  這條命令將編譯CTS套機,編譯出的結果放在out目錄對應版的data/app目錄下面。CTS測試時有用

4.make installclean
  
這條命令清除out目錄下對應板檔案夾中的內容,也就是相當於make clean,通常如果改變了一些資料檔案(如去掉)、最好執行以下make installclean,否則殘留在out目錄下的還會被打包進去。

5.mm/mm -B
  
開發調試中最喜歡這條命令了,在修改了的目錄下執行這條命令,就能智能地進行編譯,輸出的檔案在通過adb推送到目標機,可以很方便地調試。

6.make sdk
  
這條命令可以產生可發布的SDK,目前還沒試過,據說需要JDK1.5

7.make Setting
  
可以單獨編譯setting這個模組,目前還沒試,猜想是不是可以單獨編譯Email、Music這些模組

8.make bootimage
  
用這條命令可以產生boot.img,這個鏡像檔案中包含Linux Kernel,Ram disk,產生的boot.img只能通過fastboot進行燒寫,這在只修改了Linux核心的時候有用

 

 

Android比較重要的三個img檔案:

 

  • make systemimage - system.img
  • make userdataimage - userdata.img
  • make ramdisk - ramdisk.img
  • make snod - 快速打包system.img (with this command, it will build a new system.img very quickly. well, you cannot use “make snod” for all the situations. it would not check the dependences. if you change some code in the framework which will effect other applications)

 

 

 

因為
system.img 是 從 out/target/product/xxxx/system 做出來的。
如果改了 這個 folder 的內容,想要重新產生 system.img。不要管 system folde 裡面的 file 的 dependency,可以用 snod 這個 target:

 

  • make snod

 

定義在 build/core/Makefile 可以看到 snod 這個 target:
(有說明是: make system.img ignoring depencies)

 

.PHONY: systemimage-nodeps snod
systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
| $(INTERNAL_MKUSERFS)
@echo "make [email protected]: ignoring dependencies"
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)

 

Ref:
http://hi.baidu.com/kyan/blog/item/df7ea8d346f5c839960a163c.html
http://r40eubuntu.blogspot.com/2010/10/systemimg.html

 

Android常用的一些make命令(轉載)--不錯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.