از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
ابزارهای کنترل منبع
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
کار با کد اندروید نیازمند استفاده از Git (یک سیستم کنترل نسخه منبع باز) و Repo (ابزار مدیریت مخزن ساخته شده توسط گوگل است که در بالای Git اجرا می شود). برای خلاصهای از اقدامات منظمی که میتوانید انجام دهید، مانند بارگذاری تغییرات برای بررسی، گردش کار کنترل منبع را ببینید.
Git
Git پروژه های بزرگی را مدیریت می کند که در چندین مخزن توزیع شده اند. اندروید از Git برای عملیات محلی مانند شاخهبندی محلی، commitها، تفاوتها و ویرایشها استفاده میکند. یکی از چالشهای راهاندازی پروژه اندروید، تعیین نحوه حمایت از جامعه بیرونی-از جامعه سرگرمیها تا تولیدکنندگان بزرگ تولیدکننده دستگاههای مصرفکننده در بازار انبوه- بود. ما میخواستیم اجزا قابل تعویض باشند و میخواستیم اجزای جالب زندگی خود را خارج از اندروید داشته باشند. ما ابتدا یک سیستم کنترل بازبینی توزیع شده را انتخاب کردیم، سپس آن را به Git محدود کردیم.
برای جزئیات بیشتر در مورد Git، به این مستندات Git مراجعه کنید.
مخزن
Repo در صورت لزوم مخازن Git را یکپارچه می کند، آپلودها را در سیستم کنترل بازبینی Gerrit انجام می دهد و بخش هایی از گردش کار توسعه Android را خودکار می کند.
راهانداز Repo یک اسکریپت پایتون ارائه میکند که یک پرداخت اولیه را آغاز میکند و قسمت دوم، ابزار کامل Repo را دانلود میکند. ابزار کامل Repo در بررسی کد منبع اندروید گنجانده شده است. به طور پیشفرض در $SRCDIR/.repo/repo/...
قرار دارد و دستورات ارسالشده را از راهانداز Repo دانلود شده دریافت میکند.
Repo جایگزین Git نمی شود، فقط کار با Git را در زمینه اندروید آسان می کند. Repo از فایل های مانیفست برای جمع آوری پروژه های Git در ابرپروژه اندروید استفاده می کند. می توانید دستور repo
را که یک اسکریپت اجرایی پایتون است، در هر نقطه از مسیر خود قرار دهید. در کار با فایلهای منبع Android، میتوانید از Repo برای عملیاتهای بین شبکهای مانند با یک فهرست کاری Repo استفاده کنید.
در اکثر مواقع، می توانید به جای Repo از Git استفاده کنید یا دستورات Repo و Git را برای ایجاد دستورات پیچیده ترکیب کنید. با این حال، استفاده از Repo برای عملیات اساسی در سراسر شبکه، کار شما را بسیار سادهتر میکند. برای جزئیات بیشتر در مورد Repo، به مرجع فرمان Repo ، Repo README ، Preupload Hooks (تستهایی که میتوانند در Repo فعال شوند) و اسناد عمومی در AOSP را ببینید.
برای دانلود و نصب Repo Launcher از git-repo-downloads ، به Install Repo مراجعه کنید.
گریت
Gerrit یک سیستم بررسی کد مبتنی بر وب برای پروژه هایی است که از Git استفاده می کنند. Gerrit استفاده متمرکزتر از Git را با اجازه دادن به همه کاربران مجاز برای ارسال تغییرات تشویق می کند که در صورت تصویب کد، تغییرات به طور خودکار ادغام می شوند. علاوه بر این، Gerrit بررسی، نمایش تغییرات در کنار هم در مرورگر و فعال کردن نظرات درون خطی را ساده می کند.
رابط بررسی Android Gerrit را در android-review.googlesource.com و رابط پیمایش کد را در android.googlesource.com پیدا کنید.
جستجوی کد اندروید
Android Code Search به شما امکان می دهد بدون دانلود چیزی در AOSP جستجو کنید. میتوانید از Code Search برای مشاهده کد منبع AOSP، جابهجایی بین شاخههای منبع باز و پیمایش منابع متقابل استفاده کنید. برای اطلاعات بیشتر، به سایت Google Developers برای مستندات جستجوی کد مراجعه کنید.
Android Studio محیط توسعه یکپارچه رسمی (IDE) برای توسعه برنامه اندروید است.
Android Debug Bridge (adb) به شما امکان میدهد ایستگاه کاری توسعه خود را مستقیماً به دستگاه مجهز به Android خود متصل کنید تا بتوانید بستهها را نصب کنید و تغییرات خود را ارزیابی کنید.
برای توسعه AOSP، از Android Studio for Platform (ASfP) استفاده کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-08-12 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-12 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Source control tools\n\nWorking with Android code requires using both **Git** (an open-source\nversion-control system) and **Repo** (a Google-built\nrepository-management tool that runs on top of Git). See\n[Source control workflow](/docs/setup/create/coding-tasks) for a summary of\nregular actions you can take, such as uploading changes for review.\n\nGit\n---\n\nGit handles large projects that are distributed over multiple repositories.\nAndroid uses Git for local operations such as local branching, commits,\ndiffs, and edits. One of the challenges in setting up the Android project\nwas determining how to best support the outside community---from the hobbyist\ncommunity to the large OEMs building mass-market consumer devices. We\nwanted components to be replaceable, and wanted interesting components to\nhave a life of their own, outside of Android. We first chose a distributed\nrevision control system, then narrowed it down to Git.\n\nFor more details on Git, refer to this [Git Documentation](https://git-scm.com/doc).\n\nRepo\n----\n\n[Repo](https://gerrit.googlesource.com/git-repo/+/refs/heads/main/README.md)\nunifies Git repositories when necessary, performs uploads to the [Gerrit\nrevision control system](https://android-review.googlesource.com/), and\nautomates parts of the Android development workflow.\n\nThe Repo Launcher provides a Python script that initializes a checkout and\ndownloads the second part, the full Repo tool. The full Repo tool is\nincluded in an Android source code checkout. It's located, by default, in\n`$SRCDIR/.repo/repo/...` and it receives forwarded commands from the\ndownloaded Repo Launcher.\n\nRepo doesn't replace Git, it only makes it easier to work with Git in the\ncontext of Android. Repo uses [manifest files](https://gerrit.googlesource.com/git-repo/+/main/docs/manifest-format.md)\nto aggregate Git projects into the Android superproject. You can put the\n`repo` command, which is an executable Python script, anywhere in your\npath. In working with the Android source files, you can use Repo for\nacross-network operations such as with a single Repo working directory.\n\nIn most situations, you can use Git instead of Repo, or mix Repo and Git\ncommands to form complex commands. However, using Repo for basic\nacross-network operations makes your work much simpler. For more details\non Repo, see [Repo command reference](/docs/setup/reference/repo),\n[Repo README](https://gerrit.googlesource.com/git-repo/+/refs/heads/main/README.md),\n[Preupload Hooks](https://android.googlesource.com/platform/tools/repohooks/+/refs/heads/android16-release/README.md)\n(tests that can be enabled in Repo), and [general docs in AOSP](https://gerrit.googlesource.com/git-repo/+/main/docs/).\n\nTo download and install the **Repo Launcher** from *git-repo- downloads* ,\nsee [Install Repo](/docs/setup/start/requirements#repo).\n\nGerrit\n------\n\n[Gerrit](https://gerrit-review.googlesource.com/Documentation/) is a\nweb-based code review system for projects that use Git. Gerrit encourages a\nmore centralized use of Git by allowing all authorized users to submit\nchanges, which are automatically merged if they pass code review. In\naddition, Gerrit simplifies reviewing, displaying changes side by side in\nthe browser and enabling inline comments.\n\nFind the Android Gerrit review interface at\n[android-review.googlesource.com](https://android-review.googlesource.com/)\nand the code navigation interface at\n[android.googlesource.com](https://android.googlesource.com/).\n\nAndroid Code Search\n-------------------\n\n[Android Code Search](https://cs.android.com) lets you search AOSP without\ndownloading anything. You can use Code Search to view the AOSP source code,\nswitch between open source branches, and navigate cross-references. For more\ninformation, see the Google Developers site for the [Code search\ndocumentation](https://developers.google.com/code-search).\n\nOther tools\n-----------\n\n[Android Studio](https://developer.android.com/studio/intro) is the official\nintegrated development environment (IDE) for Android app development.\n\n[Android Debug Bridge (adb)](/docs/setup/build/adb) lets you connect your\ndevelopment workstation directly to your Android-powered device so you can\ninstall packages and evaluate your changes.\n\nFor AOSP development, use [Android Studio for Platform\n(ASfP)](https://developer.android.com/studio/platform)."]]