專案總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android Studio for Platform 中的專案包含可定義 AOSP 程式碼庫工作區的所有內容,包括原始碼、資產、測試程式碼和建構設定。
當您啟動新專案時,Android Studio for Platform 會為所有檔案建立必要的結構,並顯示在 Android Studio 的「Project」視窗中。如要開啟這個視窗,請依序選取「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
:這裡的所有路徑都不會產生原生來源。
請注意,您可以使用萬用字元 (*
) 符號,表示存放區結帳中的所有路徑。
同步處理參數
Sync 接受使用者定義的建構 (m
指令) 旗標和環境變數。您可以在 asfp-config.json
中透過下列方式設定這些項目:
"syncConfig" : {
"environmentVars" : {
"a": "1",
"b": "2"
},
"buildFlags" : [
"--u=v",
"-x"
]
}
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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 }"]]