اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تفعيل تصحيح أخطاء USB في إصدارات المستخدمين تلقائيًا
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بعد فلاش إصدار المستخدم على جهاز، عليك إعادة تفعيل تصحيح أخطاء USB. يمكن لخدمة OmniLab ATS تنفيذ هذه الخطوة تلقائيًا باستخدام إجراءات AOA للأجهزة التي تُرسِل بدورها سلسلة من أوامر واجهة المستخدم إلى الجهاز.
تسجيل أوامر AOA
أولاً، استخدِم أداة تعديل أوامر WebAOA لتسجيل قائمة الأوامر بهدف
تفعيل وضع تصحيح أخطاء USB.
الشكل 1: رابط إلى أداة تعديل أوامر WebAOA في OmniLab ATS
ويمكن الوصول إليه أيضًا على الرابط http://localhost:8000/webaoa
تلقائيًا.
تتيح لك أداة WebAOA التحكّم في جهاز محلي باستخدام شاشة تعمل باللمس ومحاكاة
تسجيل تفاعلاتك مع واجهة المستخدم.
الشكل 2: تعديل الأوامر لتفعيل تصحيح أخطاء USB في WebAOA
تتوفّر أربعة أنواع من الأوامر:
النقر والتمرير السريع على الشاشة التي تعمل باللمس
(click X Y
و
swipe X1 Y1 DURATION X2 Y2
)
الضغط على أزرار الجهاز (back
وhome
وwake
)
كتابة نص والضغط على مجموعات مفاتيح
(write TEXT
و
key [KEY ...]
)
في انتظار مدة زمنية محدّدة (sleep DURATION
)
عند الانتهاء من تسجيل الأوامر، يمكنك نسخها إلى الحافظة أو
حفظها في ملف.
إنشاء إجراء جهاز على AOA
لإعادة تفعيل ميزة "تصحيح أخطاء USB" تلقائيًا، يجب إضافة الأوامر المسجّلة
إلى إجراء الجهاز.
أنشئ إجراء جهاز جديدًا و
أضِف عنصر إعداد استهداف TF مع ضبط اسم صفّه على
com.android.tradefed.targetprep.AoaTargetPreparer
.
انسخ الأوامر المسجّلة في WebAOA إلى خيار action
.
الشكل 3: إجراء جهاز AOA لتفعيل تصحيح أخطاء USB على نظام التشغيل Android 10 GSI
استخدام إجراء جهاز AOA
عند تحديد موعد لإجراء اختبار، أضِف إجراء AOA للجهاز وضعه مباشرةً
بعد إجراء فلاش الجهاز.
الشكل 4: جدولة عملية لفلاش إصدار المستخدم وإعادة تفعيل تصحيح أخطاء USB
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ 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,["# Enable USB debugging on user builds automatically\n\nAfter flashing a user build onto a device, you need to re-enable USB\ndebugging. OmniLab ATS can automate this step using *AOA device actions*, which\nsend a series of UI commands to a device.\n| **Note:** This procedure uses the [Android Open Accessory protocol](/docs/core/interaction/accessories/protocol), which supports Android 4.1+ and doesn't require ADB.\n\nRecord the AOA commands\n-----------------------\n\nFirst, use the *WebAOA command editing tool* to record the list of commands to\nenable USB debugging.\n\n**Figure 1.** Link to the WebAOA command editing tool in OmniLab ATS.\n\nIt is also accessible at \u003chttp://localhost:8000/webaoa\u003e\nby default.\n\nWebAOA lets you manipulate a local device using a simulated touchscreen and\nrecord your UI interactions.\n\n**Figure 2.** Editing the commands for enabling USB debugging in WebAOA.\n\nFour types of commands are supported:\n\n- Clicking and swiping on the touchscreen\n (`click `\u003cvar translate=\"no\"\u003eX\u003c/var\u003e` `\u003cvar translate=\"no\"\u003eY\u003c/var\u003e and\n `swipe `\u003cvar translate=\"no\"\u003eX1\u003c/var\u003e` `\u003cvar translate=\"no\"\u003eY1\u003c/var\u003e` `\u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e` `\u003cvar translate=\"no\"\u003eX2\u003c/var\u003e` `\u003cvar translate=\"no\"\u003eY2\u003c/var\u003e)\n\n- Pressing device buttons (`back`, `home`, and `wake`)\n\n- Writing text and pressing key combinations\n (`write `\u003cvar translate=\"no\"\u003eTEXT\u003c/var\u003e and\n `key [`\u003cvar translate=\"no\"\u003eKEY\u003c/var\u003e` ...]`)\n\n- Waiting for a specified duration (`sleep `\u003cvar translate=\"no\"\u003eDURATION\u003c/var\u003e)\n\nWhen you are finished recording commands, you can copy them to your clipboard or\nsave them to a file.\n\nCreate an AOA device action\n---------------------------\n\nTo automatically re-enable USB debugging, the recorded commands need to be added\nto a device action.\n\n[Create a new device action](/docs/core/tests/development/android-test-station/ats-user-guide#create-a-new-device-action) and\nadd a TF Target Preparer with its class name set to\n[`com.android.tradefed.targetprep.AoaTargetPreparer`](/reference/tradefed/com/android/tradefed/targetprep/AoaTargetPreparer).\nCopy the commands recorded in WebAOA into its `action` option.\n\n**Figure 3.** AOA device action for enabling USB debugging on Android 10 GSI.\n\nUse an AOA device action\n------------------------\n\nWhen scheduling a test run, add your AOA device action and place it directly\nafter your device-flashing action.\n\n**Figure 4.** Scheduling a run to flash a user build and re-enable USB\ndebugging."]]