اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
أدوات التحكّم في المصدر
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يتطلّب العمل باستخدام رمز Android استخدام كل من Git (نظام مفتوح المصدر للتحكّم في الإصدارات) وRepo (أداة لإدارة المستودعات من Google تعمل على Git). راجِع مقالة
سير عمل نظام التحكّم بالمصادر للحصول على ملخّص حول
الإجراءات العادية التي يمكنك اتّخاذها، مثل تحميل التغييرات للمراجعة.
Git
يتعامل Git مع المشاريع الكبيرة الموزّعة على مستودعات متعددة.
يستخدم نظام التشغيل Android Git في العمليات المحلية، مثل إنشاء فروع محلية وعمليات الدمج
والاختلافات والتعديلات. كان أحد التحديات التي واجهتنا عند إعداد مشروع Android هو تحديد أفضل طريقة لتقديم الدعم للمنتدى الخارجي، بدءًا من المنتدى الذي يضم هواة إلى الشركات المصنّعة الأصلية الكبيرة التي تصنع أجهزة استهلاكية للأسواق العامة. أردنا أن تكون المكوّنات قابلة للاستبدال، وأن يكون للمكوّنات المثيرة للاهتمام عمر افتراضي خاص بها خارج نطاق Android. لقد اخترنا أولاً نظامًا موزّعًا للتحكّم في المراجعات، ثمّ حصرنا الخيارات في Git.
لمزيد من التفاصيل حول Git، يُرجى الرجوع إلى مستندات Git.
Repo
Repo
يوحّد مستودعات Git عند الضرورة، ويحمّل البيانات إلى نظام التحكّم في المراجعات Gerrit، كما يتيح إتمام أجزاء من سير عمل تطوير Android تلقائيًا.
توفّر أداة Repo Launcher نصًا برمجيًا بلغة Python يبدأ عملية استخراج
وينزّل الجزء الثاني، وهو أداة Repo الكاملة. يتم تضمين أداة Repo الكاملة في عملية استخراج رمز مصدر Android. يتم حفظها تلقائيًا في
$SRCDIR/.repo/repo/...
وتتلقّى الأوامر المُعاد توجيهها من
Repo Launcher الذي تم تنزيله.
لا يحلّ Repo محل Git، بل يسهّل فقط استخدام Git في سياق Android. يستخدم Repo ملفات البيان لتجميع مشاريع Git في مشروع Android الرئيسي. يمكنك وضع الأمر
repo
، وهو نص برمجي قابل للتنفيذ بلغة Python، في أي مكان ضمن مسارك. عند العمل باستخدام ملفات المصدر لنظام Android، يمكنك استخدام Repo لإجراء عمليات على مستوى الشبكة، مثل استخدام دليل عمل Repo واحد.
في معظم الحالات، يمكنك استخدام Git بدلاً من Repo، أو مزج أوامر Repo وGit لتكوين أوامر معقّدة. ومع ذلك، فإنّ استخدام Repo للعمليات الأساسية على مستوى الشبكة يسهّل عملك كثيرًا. لمزيد من التفاصيل حول Repo، يُرجى الاطّلاع على مرجع أوامر Repo وملف Repo README وخطافات ما قبل التحميل (الاختبارات التي يمكن تفعيلها في Repo) والمستندات العامة في AOSP.
لتنزيل وتثبيت Repo Launcher من عمليات تنزيل git-repo،
راجِع تثبيت Repo.
Gerrit
Gerrit هو نظام مراجعة للرموز البرمجية على الويب للمشاريع التي تستخدم Git. تشجّع Gerrit على استخدام Git بشكل أكثر مركزية من خلال السماح لجميع المستخدمين المصرّح لهم بإرسال التغييرات، والتي يتم دمجها تلقائيًا إذا اجتازت مراجعة الرمز البرمجي. بالإضافة إلى ذلك، يسهّل Gerrit عملية المراجعة، ويعرض التغييرات جنبًا إلى جنب في المتصفّح، ويتيح إضافة تعليقات مضمّنة.
يمكنك العثور على واجهة مراجعة Android Gerrit على
android-review.googlesource.com
وواجهة التنقّل في الرمز على
android.googlesource.com.
Android Code Search
تتيح لك خدمة البحث عن الرموز البرمجية على Android البحث في مشروع AOSP بدون الحاجة إلى تنزيل أي شيء. يمكنك استخدام "بحث الرموز" لعرض رمز المصدر AOSP والتبديل بين فروع المصدر المفتوح والتنقّل بين المراجع المتبادلة. لمزيد من المعلومات، يُرجى الاطّلاع على مستندات "بحث Google عن الرموز" على موقع Google Developers الإلكتروني.
Android Studio هي بيئة التطوير المتكاملة (IDE) الرسمية لتطوير تطبيقات Android.
تتيح لك أداة تصحيح أخطاء Android (adb) توصيل محطة عمل التطوير مباشرةً بجهازك الذي يعمل بنظام التشغيل Android، ما يتيح لك تثبيت الحِزم وتقييم التغييرات التي أجريتها.
لتطوير AOSP، استخدِم Android Studio for Platform
(ASfP).
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-13 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-13 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)."]]