自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
AOSP 概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AndroidAndroid 是适用于各种不同规格设备的操作系统。任何人都可以通过 Android 开源项目 (AOSP) 查看 Android 的文档和源代码。您可以使用 AOSP 为自己的设备创建自定义 Android OS 变体。
AOSP 的设计可确保不存在一个集中瓶颈,即没有任何行业参与者可一手限制或控制其他参与者的创新。因此,AOSP 是一款功能完善且达到生产质量的开发者产品,其源代码可以开放自定义和移植。
本部分文档可帮助新 AOSP 开发者开始使用该平台,并执行基本的开发任务。
必知术语
下面列出了本入门文档中使用的术语和定义。您应先研究每项定义,然后再继续阅读。
- Android 应用开发者
Android 应用开发者负责编写 Android 应用,即在 Android 上运行的应用。应用开发者分为两类:第一方 (1p) 应用开发者和第三方 (3p) 应用开发者。
- Android 第一方应用开发者
- 有权访问 AOSP 系统 API 并编写特权应用和设备制造商应用的 Android 应用开发者。
- Android 第三方应用开发者
- 仅使用 Android 的公共 SDK 创建 Android 应用的 Android 应用开发者。
如果您要开发适用于 Android 的第三方应用,请参阅 developers.android.com
。本网站上的信息仅适用于直接使用 AOSP 的人员。
- Android 调试桥 (adb)
- 一种命令行工具 (
adb
),可让您的工作站与虚拟、软件模拟或实体设备进行通信。
- 与 Android 兼容的设备
- 可运行由第三方开发者使用 Android SDK 和 NDK 编写的任何第三方应用的设备。与 Android 兼容的设备必须遵守兼容性定义文档 (CDD) 中的要求,并通过兼容性测试套件 (CTS) 的测试。与 Android 兼容的设备有资格加入 Android 生态系统,其中包括获得 Android Play 商店和 Google 移动服务 (GMS) 应用和 API 套件的潜在许可,以及对 Android 商标的使用。我们欢迎任何人使用 Android 源代码,但要成为 Android 生态系统的一部分,设备必须与 Android 兼容。如需详细了解兼容性和 CTS,请参阅 Android 兼容性计划概览。
- 兼容性定义文档 (CDD)
- 一种文档,列出了与 Android 兼容的设备应遵循的软件和硬件要求。
- 贡献者
为 AOSP 源代码做贡献的人。贡献者可以是 Google 或其他公司的员工,也可以是不属于任何公司的个人。每个 AOSP 贡献者都使用相同的工具、遵循相同的代码审核流程,并受相同的编码样式所约束。您无需成为贡献者即可使用 AOSP;您可以下载 AOSP,根据自己的需求进行修改,并将其部署到设备上,而无需贡献代码供他人使用。
Google 接受的代码贡献类型存在一定限制。例如,您可能想要贡献一个替代应用 API,例如完全基于 C++ 的环境。Google 会拒绝这种贡献内容,因为 Android 鼓励开发在 ART 运行时中运行的应用。同样,Google 也不会接受与许可目标不符的贡献内容(例如 GPL 或 LGPL 库)。
如果您有意贡献源代码,请在开始工作之前与 Google 联系。
- 兼容性测试套件 (CTS)
一个免费的商业级测试套件,可以下载二进制文件版本,也可以在 AOSP 中下载源代码版本。CTS 是一组单元测试,旨在集成到您的日常工作流程中。其目的是发现不兼容性,并确保软件在整个开发过程中保持兼容性。
- Cuttlefish
一种由 Android 提供支持的可配置虚拟设备,可使用第三方云产品(如 Google Cloud Engine)远程运行,还可在 Linux x86 计算机上本地运行。
- 开发者
对于 AOSP 来说,开发者是指以任何方式使用 AOSP 的任何人。“开发者”一词泛指可能会阅读本文档的各种不同人员,例如原始设备制造商 (OEM)、手机制造商、运营商和系统芯片 (SoC) ) 创建者。
- Google 移动服务 (GMS)
可在设备上预安装的一系列 Google 应用和 API。
- 目标
设备组合,例如特定型号或设备规格。例如,aosp_cf_x86_64_phone-userdebug
表示一部 x86 65MB 手机,其中包含旨在运行在 Cuttlefish 模拟器上的调试信息。
管理理念
Android 源自于 Google 牵头并联合众多企业成立的开放手持设备联盟 (OHA)。如今,许多企业(包括 OHA 的创始成员以及其他企业)都在 Android 上投入了大量资金和人力。这些企业投入了大量工程资源来改进 Android,使用户能够享用搭载 Android 的出色设备。
这些企业在 Android 上投入了大量资金和人力,因为他们相信有必要打造一个开放的平台。我们的用意是将 Android 打造成一个开放源代码(而非免费软件)平台,显然,Android 也确实做到了这一点;众多志同道合的组织投入了大量的资源,携手打造了一个共用的平台。Android 的首要理念是务实。目标是打造一个每个贡献者都可以调整和定制的共用产品。
不受约束的定制必然会导致不兼容。为了防止不兼容,Android 开源项目 (AOSP) 还推出了 Android 兼容性计划,该计划阐释了与 Android 兼容的含义以及设备制造商实现这种兼容性需要满足的要求。任何人都能够将 Android 源代码用于任何用途,Google 欢迎一切合法的使用。不过,要参与 OHA 成员正在围绕 Android 构建的共通应用生态系统,设备制造商必须加入 Android 兼容性计划。
作为 AOSP 的主导者,Google 负责 Android 的维护和后续开发工作。虽然 Android 由多个子项目组成,但严格意义上,AOSP 这样只是出于项目管理的需要。Google 将 Android 整体视为一个软件产品(而不是可更换部件的“发行版”、规范或集合),并依此原则进行管理。Google 希望设备制造商只需将 Android 移植到其设备上,而无需实现一个规范或构建一个“发行版”。
后续操作
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-04。
[null,null,["最后更新时间 (UTC):2025-04-04。"],[],[],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)."]]