自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
Android 開放原始碼計畫總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 是一種作業系統,適用於各種板型規格的裝置。任何人都可以透過 Android 開放原始碼計畫 (AOSP) 取得 Android 說明文件和原始碼。您可以使用 AOSP,為自己的裝置建立自訂的 Android 作業系統變化版本。
AOSP 的設計目的是避免出現單一故障點,讓某個產業參與者限制或控制其他人的創新。因此,AOSP 是完整的開發人員產品,具有可供自訂和移植的原始碼,並符合實際工作環境的品質。
本節說明文件可協助新手 AOSP 開發人員開始使用平台,並執行必要的開發工作。
必要條款
以下是「開始使用」說明文件中使用的術語和定義清單。請先詳閱每個定義,再繼續操作。
- Android 應用程式開發人員
Android 應用程式開發人員會編寫 Android 應用程式或在 Android 上執行的應用程式。應用程式開發人員分為兩類:第一方 (1p) 和第三方 (3p) 應用程式開發人員。
- Android 第一方應用程式開發人員
- 具備 AOSP 系統 API 存取權,且撰寫特權和裝置製造商應用程式的 Android 應用程式開發人員。
- Android 第三方應用程式開發人員
- Android 應用程式開發人員,僅使用 Android 的公開 SDK 建立 Android 應用程式。
如要開發 Android 版第三方應用程式,請參閱 developers.android.com
。本網站上的資訊僅供直接與 AOSP 合作的人員使用。
- Android Debug Bridge (ADB)
- 指令列工具 (
adb
),可讓工作站與虛擬、軟體模擬或實體裝置進行通訊。 - Android 相容裝置
- 可執行任何由第三方開發人員使用 Android SDK 和 NDK 編寫的第三方應用程式的裝置。與 Android 相容的裝置必須遵守相容性定義說明文件 (CDD) 的規定,並通過相容性測試套件 (CTS) 測試。支援 Android 的裝置可參與 Android 生態系統,包括 Android Play 商店的潛在授權、Google 行動服務 (GMS) 應用程式和 API 套件的潛在授權,以及 Android 商標的使用權。任何人都可以使用 Android 原始碼,但裝置必須與 Android 相容,才能算是 Android 生態系統的一部分。如要進一步瞭解相容性和 CTS,請參閱 Android 相容性計畫總覽
- 相容性定義文件 (CDD)
- 這份文件列出 Android 相容裝置的軟硬體需求。
- 提供者
對 Android 開放原始碼計畫原始碼做出貢獻的人。貢獻者可以是 Google 員工、其他公司的員工,以及與任何公司都沒有關聯的個人。每位 AOSP 貢獻者都會使用相同的工具、遵循相同的程式碼審查程序,並遵守相同的程式碼編寫風格。您不必是貢獻者,也能使用 AOSP;您可以下載 AOSP,根據自己的需求進行修改,然後在裝置上部署,無須將程式碼提供給他人使用。
Google 接受的程式碼貢獻類型有限制。舉例來說,您可能想提供其他應用程式 API,例如以 C++ 為基礎的完整環境。Google 會拒絕這項貢獻,因為 Android 鼓勵應用程式在 ART 執行階段執行。同樣地,Google 也不接受 GPL 或 LGPL 程式庫等與授權目標不相容的貢獻內容。
如果您有意提供原始碼,請先與 Google 聯絡,再開始著手。
- Compatibility Test Suite (CTS)
免費的商業級測試套件,可下載為 AOSP 中的二進位檔或來源。CTS 是一組單元測試,可整合至您的日常工作流程。CTS 的用意是揭露不相容性,並確保軟體在整個開發過程中保持相容性。
- 烏賊
可設定的 Android 虛擬裝置,可透過第三方雲端服務 (例如 Google Cloud Engine) 遠端執行,並在 Linux x86 機器上執行。
- Developer
在 AOSP 的情況下,開發人員是指任何以任何方式與 AOSP 合作的人員。「開發人員」一詞是指可能閱讀本說明文件的各種人員,例如原始設備製造商 (OEM)、手機製造商、電信業者和晶片系統 (SoC) 創作者。
- Google 行動服務 (GMS)
可在裝置上預先安裝的 Google 應用程式和 API 集合。
- Target
裝置的變體,例如特定型號或板型規格。舉例來說,aosp_cf_x86_64_only_phone-userdebug
代表 x86 65MB 手機,其中包含設計用於在 cuttlefish 模擬器上執行的偵錯資訊。
治理理念
Android 是由一群公司 (稱為開放手持裝置聯盟,簡稱 OHA) 所創立,Google 為該聯盟的領導者。目前許多公司 (包括 OHA 原始成員和其他公司) 都已在 Android 上投入大量資金。這些公司已分配大量工程資源來改善 Android 並將 Android 裝置推向市場。
投資 Android 的企業之所以這麼做,是因為他們認為開放平台是必要的。Android 是刻意且明確的開放原始碼計畫 (而非免費軟體),由一群有共同需求的機構集結資源,共同實作單一共用產品。首先,Android 的理念是務實的。目標是共用產品,每位內容提供者都可以調整及自訂。
當然,未經控管的客製化可能會導致不相容的實作方式。為避免相容性問題,Android 開放原始碼計畫 (AOSP) 會維護 Android 相容性計畫,說明「Android 相容性」的涵義,以及裝置建構工具需要符合哪些條件才能達到相容性。任何人都可以將 Android 原始碼用於任何用途,Google 歡迎所有合法用途。不過,如果裝置製造商想參與 OHA 成員圍繞 Android 建構的應用程式共用生態系統,就必須參與 Android 相容性計畫。
Android 開放原始碼計畫由 Google 負責領導,負責維護及進一步開發 Android。雖然 Android 包含多個子專案,但 AOSP 嚴格來說是專案管理。Google 將 Android 視為單一完整的軟體產品,並以此管理 Android,而非將其視為可替換零件的發行版本、規格或集合。Google 的意圖是讓裝置建構工具將 Android 移植到裝置;他們不會實作規格或策劃發行作業。
後續步驟
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-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-07-27 (世界標準時間)。"],[],[],null,["# AOSP overview\n\n*Android* is an operating system for a wide array of devices with different\nform factors. The documentation and source code for Android is available to\nanyone as the *Android Open Source Project (AOSP)*. You can use\nAOSP to create custom variants of the Android OS for your own devices.\n\nAOSP is designed so that there's no central point of failure, where one\nindustry player restricts or controls the innovations of another. Therefore,\nAOSP is a full, production-quality developer product with source code open for\ncustomization and porting.\n\nThis section of documentation helps new AOSP developers get started with the\nplatform and to perform essential development tasks.\n\nRequired terms\n--------------\n\nFollowing is a list of terms and definitions used throughout the Getting\nStarted documentation. You should study each definition before continuing\nfurther.\n\n*Android app developer*\n\n: Android app developers writes *Android apps* or applications that run on\n Android. There are two classification of app developers: first-party (1p) and\n third-party (3p) app developers.\n\n *Android first-party app developer*\n : An Android app developer that has access to AOSP System APIs and writes\n privileged and device manufacturer apps.\n\n *Android third-party app developer*\n : An Android app developer who solely uses Android's public SDK to create\n Android apps.\n\nIf you want to develop third-party apps for Android, refer to\n[`developers.android.com`](https://developer.android.com/). The information on\nthis website is solely for those working directly with AOSP.\n\n*Android debug bridge (adb)*\n: A command-line tool (`adb`) that allows your workstation communicate with a\n virtual, software-emulated, or physical device.\n\n*Android-compatible device*\n: A device that can run any third-party app written by third-party developers\n using the Android SDK and NDK. Android-compatible devices must adhere to the\n requirements of the\n [Compatibility Definition Document (CDD)](#cdd) and pass the\n [Compatibility Test Suite (CTS)](#cts). Android-compatible\n devices are eligible to participate in the Android ecosystem which includes\n potential licensure of the Android Play Store, potential licensure the\n [Google Mobile Services (GMS)](#gms) suite of\n applications and APIs, and use of the Android trademark. Anyone is welcome to\n use the Android source code, but to be considered part of the Android ecosystem,\n a device must be Android-compatible. For further information on compatibility\n and CTS, see the\n [Android Compatibility Program overview](/docs/compatibility/overview)\n\n*Compatibility Definition Document (CDD)*\n: A document that enumerates the software and hardware requirements for an\n Android-compatible device.\n\n*Contributor*\n\n: A person who makes contributions to the AOSP source code. Contributors\n can be employees of Google, employees from other companies, and individuals\n with no company affiliation. Every AOSP contributor uses the same tools, follows\n the same code review process, and is subject to the same coding style. You\n don't have to be a contributor to use AOSP; you can download AOSP,\n modify it for your own needs, and deploy it on a device without contributing\n code for others to use.\n\n There are limits to the type of code contributions Google accepts. For example,\n you might want to contribute an alternative application API, such as a full\n C++-based environment. Google would decline that contribution because Android\n encourages applications to be run in the ART runtime. Similarly, Google doesn't\n accept contributions such as GPL or LGPL libraries that are incompatible with\n licensing goals.\n\n If you are interested in contributing source code,\n [contact Google](/docs/setup/community) prior to beginning work.\n\n*Compatibility Test Suite (CTS)*\n\n: A free, commercial-grade test suite, available for download as a binary or as\n source in AOSP. The CTS is a set of unit tests designed to be integrated into\n your daily workflow. CTS's intent is to reveal incompatibilities, and ensure\n that the software remains compatible throughout the development process.\n\n*Cuttlefish*\n\n: A configurable virtual Android-powered device that can run remotely, using\n third-party cloud offerings, such as Google Cloud Engine, and locally on Linux\n x86 machines.\n\n*Developer*\n\n: In the context of AOSP, a developer is anyone who works with AOSP in any\n way. The term \"developer\" is used to generically refer to the various people who\n might read this documentation, such as original equipment manufacturers\n (OEMs), handset makers, carriers, and System-on-a-Chip (SoC) creators.\n\n*Google Mobile Services (GMS)*\n\n: A collection of Google apps and APIs that can be pre-installed on devices.\n\n*Target*\n\n: A permutation of a device, such as a specific model or form factor. For\n example, `aosp_cf_x86_64_only_phone-userdebug` represents a x86 65MB phone with\n debugging information that is designed to run on the cuttlefish emulator.\n\nGovernance philosophy\n---------------------\n\nA group of companies known as the Open Handset Alliance (OHA), led by Google,\noriginated Android. Today, many companies---both original members of the OHA and\nothers---have invested heavily in Android. These companies have allocated\nsignificant engineering resources to improve Android and bring Android devices\nto market.\n\nThe companies that have invested in Android have done so because they believe an\nopen platform is necessary. Android is intentionally and explicitly an open\nsource effort (as opposed to free software); a group of organizations with\nshared needs has pooled resources to collaborate on a single implementation of a\nshared product. First and foremost, the Android philosophy is pragmatic. The\nobjective is a shared product that each contributor can tailor and customize.\n\nOf course, uncontrolled customization can lead to incompatible implementations.\nTo prevent incompatibility, the Android Open Source Project (AOSP) maintains\nthe\n[Android Compatibility program](/docs/compatibility/overview),\nwhich spells out what it means to be Android-compatible and what's required of\ndevice builders to achieve that status. Anyone can use the Android source code\nfor any purpose, and Google welcomes all legitimate uses. However, to take part\nin the shared ecosystem of applications OHA members are building around Android,\ndevice builders must participate in the Android Compatibility program.\n\nAOSP is led by Google, who maintains and further develops Android. Although\nAndroid consists of multiple subprojects, AOSP is strictly project management.\nGoogle views and manage Android as a single, holistic software product, not a\ndistribution, specification, or collection of replaceable parts. Google's intent\nis that device builders port Android to a device; they don't implement a\nspecification or curate a distribution.\n\nWhat's next?\n------------\n\n- If you're new to AOSP and want to run through a tutorial on AOSP\n development, proceed with [AOSP tutorial](/docs/setup/start).\n\n- If you believe that your device needs to be Android-compatible, refer to the\n [Android Compatibility program](/docs/compatibility/overview).\n\n- If you want to learn about the background of AOSP, including Google's\n participation in the platform, see\n [AOSP frequently asked questions](/docs/setup/about/faqs)."]]