自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
BuildInfoRecorder
public
class
BuildInfoRecorder
extends BaseTargetPreparer
用于将 build 信息元数据写入指定文件的 ITargetPreparer
。
该文件采用简单的键值对格式编写;文件中的每一行都包含:
key=value
其中 key
是 IBuildInfo
中的元数据字段
目前,系统仅会写入 build ID。
摘要
公共构造函数
BuildInfoRecorder
public BuildInfoRecorder ()
公共方法
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# BuildInfoRecorder\n=================\n\n\n`\npublic\n\n\nclass\nBuildInfoRecorder\n`\n\n\n`\n\n\n`\n\n`\n\nextends `[BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|---------------------------------------------------|\n| java.lang.Object |||\n| ↳ | [com.android.tradefed.targetprep.BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html) ||\n| | ↳ | com.android.tradefed.targetprep.BuildInfoRecorder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn [ITargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/ITargetPreparer.html) that writes build info meta data into a specified file.\n\nThe file is written in simple key-value pair format; each line of the file has: \n\n`key=value` \n\nwhere `key` is a meta data field from [IBuildInfo](../../../../../../reference/tradefed/com/android/tradefed/build/IBuildInfo.html)\n\nCurrently, only build id is written.\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[BuildInfoRecorder](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BuildInfoRecorder.html#BuildInfoRecorder())`() ` |\n\n| ### Public methods ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[setUp](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BuildInfoRecorder.html#setUp(com.android.tradefed.invoker.TestInformation))`(`[TestInformation](../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html)` testInfo) ` |\n\nPublic constructors\n-------------------\n\n### BuildInfoRecorder\n\n```\npublic BuildInfoRecorder ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### setUp\n\n```\npublic void setUp (TestInformation testInfo)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------|\n| `testInfo` | `TestInformation` \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------|---|\n| [BuildError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BuildError.html) | |\n| [DeviceNotAvailableException](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |\n| [TargetSetupError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/TargetSetupError.html) | |"]]