1. 程式人生 > >Android編譯選項eng、user、userdebug的區別 .

Android編譯選項eng、user、userdebug的區別 .

    要了解Android編譯選項eng、user和userdebug的區別,需先了解下LOCAL_MODULE_TAGS這一Android.mk檔案裡的配置項,一般配置形式為LOCAL_MODULE_TAGS := user eng optional test這個樣子。     那麼LOCAL_MODULE_TAGS設定為不同值有何作用呢?下面是對應不同值編譯的結果:     1、user:只有在user版本時該模組才被編譯進去;     2、eng:只有在eng版本時該模組才被編譯進去     3、test:只有在tests版本時該模組才被編譯進去     4、optional:在所有版本中都編譯該模組進去。
    其中的值可設定為1個或多個,分別對應編譯選項的同一個或多個。那麼eng、user、userdebug的區別是什麼呢?接下來一一揭開:     1、當make eng時,也即相當於make。此時BuildType為eng,那麼其編譯進去的內容包括:
 · Intended for platform-level debugging       · Installs modules tagged with: eng, debug, user, and/or development       · Installs non-APK modules that have no tags specified       · Installs APKs according to the product definition files, in addition to tagged APKs       · Sets ro.secure=1       · Sets ro.debuggable=0       · Sets ro.kernel.android.checkjni=1       · adbd is enabled by default     2、當make user時,此時BuildType為user,
那麼其編譯進去的內容包括: · Intended to be the final release       · Installs modules tagged as user       · Installs non-APK modules that have no tags specified       · Installs APKs according to the product definition files (tags are ignored for APK modules)       · Sets ro.secure=1       · Sets ro.debuggable=0       · adbd is disabled by default     3、當make userdebug時,
此時BuildType為userdebug,那麼其編譯進去的內容包括: the same as user, except:       · Intended for limited debugging       · Installs modules tagged with debug       · Sets ro.debuggable=1       · adbd is enabled by default      參考網址:http://hi.baidu.com/aokikyon/item/194b9bd9a6188ef593a9740e               http://www.rosoo.net/a/201108/14878.html               http://www.cnblogs.com/mr-raptor/archive/2012/06/07/2540359.html