Android中的eng和用户调试构建之间的区别

spi*_*e88 27 linux android makefile linux-kernel android-build

我想知道两者之间的区别build_flavor.

eng&user-debug

eng和用户构建风味之间的区别很明显.但是eng和用户调试让我感到困惑.在用户调试中不存在的eng中提供的附加调试工具是什么?

例如.

If I take only the Kernel being built:
Run Code Online (Sandbox Code Playgroud)

Will the Debugging levels differ for the eng and user-debug builds?

我正面临一个问题,用户调试版本在Android手机上启动.但是build build不是,build_flavor是两个构建之间的唯一区别.

任何帮助/指针表示赞赏.谢谢!

小智 51

eng:这是默认的味道.普通品与make eng相同.

- 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.
- ro.secure=0
- ro.debuggable=1
- ro.kernel.android.checkjni=1
- adb is enabled by default. 
Run Code Online (Sandbox Code Playgroud)

user:make user

这是最终版本的味道.

- Installs modules tagged with user.
- Installs non-APK modules that have no tags specified.
- Installs APKs according to the product definition files; tags are ignored for APK modules.
- ro.secure=1
- ro.debuggable=0
- adb is disabled by default.
Run Code Online (Sandbox Code Playgroud)

userdebug:make userdebug

与用户相同,除了:

Also installs modules tagged with debug.
- ro.debuggable=1
- adb is enabled by default. 
Run Code Online (Sandbox Code Playgroud)

文档:https://source.android.com/source/add-device.html#build-variants

  • 这应该被接受为正确的答案. (3认同)
  • 源文档和这个答案都没有提到 `eng` 和 `userdebug` 构建比 `user` 构建具有更宽松的 selinux 规则。注意 te 文件中 `userdebug_or_eng` 宏的用法。 (3认同)

spi*_*e88 21

那么三个版本之间的区别即.eng,user和user-debug如下:

eng - 工程构建带有默认的root访问权限.

用户 - 用户构建是在生产电话上闪现的用户构建.没有root访问权限.

user-debug - 用户调试版本没有默认的root访问权限,但可以root.它还包含额外的日志记录.

这里需要注意的一件事是,虽然eng版本可能会建议额外的日志记录,但事实并非如此.用户调试将包含最大日志记录,应在开发期间使用

  • userdebug意味着尽可能接近用户构建,只需要最少量的更改就可以调试东西,而eng构建包括一些更重的检查. (6认同)