اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تخصيص الأجهزة في Tradefed
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
عند بدء اختبار (مثل اختبار الأدوات)، قد يحتاج إلى
جهاز لكي يتمكّن من العمل بشكل صحيح. أو قد لا يحتاج الاختبار (مثل بعض اختبارات وحدات Java)
إلى جهاز على الإطلاق. وقد تحتاج بعض الاختبارات إلى أجهزة متعددة
(مثل اختبارات الهاتف والساعة). في كل هذه الحالات، يكون "مدير الأجهزة" هو
المسؤول عن تخصيص الأجهزة المطلوبة للاختبار كي يتم تنفيذه
بشكل صحيح. نُطلق على هذه المرحلة اسم خطوة تخصيص الأجهزة أو اختيار الأجهزة.
يتم تحديد المساحة من خلال
DeviceSelectionOptions
التي تسمح للاختبار بتحديد أيّ خصائص يحتاجها من جهاز، بما في ذلك:
- مستوى البطارية
- نوع الجهاز
- نوع المنتج
- الرقم التسلسلي
استخدام أجهزة حقيقية
هذا هو الإعداد التلقائي الذي سيتم تخصيصه لجميع الاختبارات التي لا تحدد أيّ خصائص للأجهزة. سيتم اختيار جهاز عشوائي يدوي تم وضع علامة عليه قائلة
متاح
وإسناده إلى الاختبار.
عدم استخدام أي أجهزة
عندما لا يحتاج الاختبار إلى أي أجهزة، يمكنه تحديد --null-device
أو -n
في سطر الأوامر، أو <option name="null-device" value="true" />
فيملف XML الخاص بالإعدادات. يؤدي ذلك إلى تخصيص عنصر نائب NullDevice يمثّل عدم تخصيص أي جهاز.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Device allocation in Tradefed\n\nWhen starting a test (for example, an instrumentation test), it might need a\ndevice to be able to run properly. Or the test (such as some Java unit tests)\nmight not need a device at all. Still others or might even need multi-devices\n(like phone + watch tests). In all those cases, the Device Manager is\nresponsible for allocating the required devices to the test so it runs\nproperly. We call this phase the *device allocation* or *device selection* step.\n\nThe allocation is driven by\n[DeviceSelectionOptions](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/src/com/android/tradefed/device/DeviceSelectionOptions.java)\nthat allow a test to declare any properties it needs from a device, including:\n\n- Battery level\n- Device type\n- Product type\n- Serial number\n\nUse real devices\n----------------\n\nThis is the default setting that will be allocated to all tests that don't\nspecify any device properties. A physical random device marked\n[AVAILABLE](/docs/core/tests/tradefed/architecture/device-manager#allocation_states)\nwill be picked and assigned to the test.\n\nUse no devices\n--------------\n\nWhen no devices are needed by the test, it can specify `--null-device` or `-n`\non its command line, or `\u003coption name=\"null-device\" value=\"true\" /\u003e` in its\nconfiguration XML. This allocates a stub placeholder NullDevice that\nrepresents no device was allocated."]]