Android編譯選項eng、user、userdebug的區別
https://www.xuebuyuan.com/1408769.html
Android編譯選項中eng、user、user-debug主要區別
https://blog.csdn.net/yanghanxing110/article/details/77721007
eng、user、userdebug區別簡述
https://blog.csdn.net/dearsq/article/details/52589376
user | userdebug | eng |
---|---|---|
僅安裝標簽為 user 的模塊 | 安裝標簽為 user、debug 的模塊 | 安裝標簽為 user、debug、eng 的模塊 |
設定屬性 ro.secure=1,打開安全檢查功能 | 設定屬性 ro.secure=1,打開安全檢查功能 | 設定屬性 ro.secure=0,關閉安全檢查功能 |
設定屬性 ro.debuggable=0,關閉應用調試功能 | 設定屬性 ro.debuggable=1,啟用應用調試功能 | 設定屬性 ro.debuggable=1,啟用應用調試功能 |
設定屬性 ro.kernel.android.checkjni=1,啟用 JNI 調用檢查 | ||
默認關閉 adb 功能 | 默認打開 adb 功能 | 默認打開 adb 功能 |
打開 Proguard 混淆器 | 打開 Proguard 混淆器 | 關閉 Proguard 混淆器 |
打開 DEXPREOPT 預先編譯優化 | 打開 DEXPREOPT 預先編譯優化 | 關閉 DEXPREOPT 預先編譯優化 |
如果目標構建變體為 user,則 adb 無法獲取 root 權限。
eng:debug 版本
user: release 版本
userDebug版本:部分debug版本
要了解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
參考網址:https://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