项目概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android Studio 中的平台项目包含为 AOSP 代码库定义工作区的所有内容,包括源代码、资源、测试代码和 build 配置等。
当您创建新项目时,Android Studio for Platform 会为您的所有文件创建必要的结构,并使其在 Android Studio 的“项目”窗口中可见。如需打开该窗口,请依次选择 View > Tool Windows > Project。
本页面将概括介绍您的项目内的主要组件。
管理项目 (asfp-config.json
)
asfp-config.json
是一个 JSON 文件,其中包含项目的所有配置选项。它位于项目目录的根目录中。
修改模块或午餐目标
项目创建时的初始模块路径存储在 asfp-config.json
中。只需向此文件添加(或从中移除)模块并保存,系统就会弹出一个通知气球,提示您进行同步。
"modulePaths" : [
"frameworks/base",
"packages/apps/Settings",
"add additional module paths here..."
],
停用原生支持
如需为项目自定义原生支持,请执行以下操作:
"nativeConfig" : {
"excludePaths" : ["*"],
"excludeGenPaths" : ["*"]
}
excludePaths
:此处的所有路径都将完全排除在原生支持之外。
excludeGenPaths
:此处的任何路径都不会包含原生生成的来源。
请注意,您可以使用通配符 (*
) 符号来表示代码库检出中的所有路径。
同步参数
同步接受用户定义的 build(m
命令)标志和环境变量。这些可以在 asfp-config.json
中通过以下方式进行配置:
"syncConfig" : {
"environmentVars" : {
"a": "1",
"b": "2"
},
"buildFlags" : [
"--u=v",
"-x"
]
}
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-27。"],[],[],null,["# Projects overview\n\nA project in Android Studio for Platform contains everything that defines\nyour workspace for your AOSP codebase, from source code and assets to test\ncode and build configurations.\n\nWhen you start a new project, Android Studio for Platform creates the necessary\nstructure for all your files and makes them visible in the Project window in\nAndroid Studio. To open the window, select View \\\u003e Tool Windows \\\u003e Project.\n\nThis page provides an overview of the key components inside your project.\n\nManaging your project (`asfp-config.json`)\n------------------------------------------\n\n`asfp-config.json` is a JSON file that contains all the configuration options\nfor your project. It is located in the root of your project directory.\n\n### Editing modules or your lunch target\n\nYour initial module paths from project creation are stored in\n`asfp-config.json`. Simply add (or remove) modules to this file and save,\nwhich should pop up a notification balloon prompting you to sync. \n\n \"modulePaths\" : [\n \"frameworks/base\",\n \"packages/apps/Settings\",\n \"add additional module paths here...\"\n ],\n\n### Disabling native support\n\nTo customize native support for your project: \n\n \"nativeConfig\" : {\n \"excludePaths\" : [\"*\"],\n \"excludeGenPaths\" : [\"*\"]\n }\n\n- `excludePaths`: All paths here will be completely excluded from native support.\n- `excludeGenPaths`: All paths here won't have native generated sources.\n\nNote that you can use the wildcard (**`*`**) symbol to indicate all paths\nin the repo checkout.\n\n### Sync parameters\n\nSync accepts user-defined build (`m` command) flags and environment\nvariables. These can be configured in `asfp-config.json` via: \n\n \"syncConfig\" : {\n \"environmentVars\" : {\n \"a\": \"1\",\n \"b\": \"2\"\n },\n \"buildFlags\" : [\n \"--u=v\",\n \"-x\"\n ]\n }"]]