Android编译选项eng、user、userdebug的区别

1. eng user userdebug 定义

eng:debug 版本,user: release 版本,userDebug:部分debug版本


2. Android.mk 中的编译选项 LOCAL_MODULE_TAGS

要了解Android编译选项 eng、user 和 userdebug 的区别,需先了解下 LOCAL_MODULE_TAGS 这一 Android.mk 文件里的配置项,一般配置形式为 LOCAL_MODULE_TAGS := user eng optional test 这个样子。其设置为不同值是对应不同编译结果的:

user:只有在user版本时该模块才被编译进去;
eng:只有在eng版本时该模块才被编译进去;
test:只有在tests版本时该模块才被编译进去;
optional:在所有版本中都编译该模块进去。

其中的值可设置为1个或多个,分别对应编译选项的同一个或多个。


3. 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://www.cnblogs.com/hellokitty2/p/11248975.html