اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
التحقّق من الأخطاء وتصحيحها
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
للتحقّق من حِزمة البلوتوث وتصحيح أخطائها، استخدِم الأدوات المقدَّمة في
AOSP واختبارات مجموعة Bluetooth Special Interest Group (SIG).
الاختبار والتحقّق
لاختبار حِزمة Bluetooth، يقدّم AOSP مجموعة من اختبارات الوحدات
واختبارات CTS وأدوات مجموعة ضبط الملف الشخصي للبلوتوث.
اختبارات الوحدة في AOSP
يتضمّن AOSP اختبارات وظيفية واختبارات وحدات لحِزمة
البلوتوث التلقائية. يمكن العثور على هذه الاختبارات في
/packages/modules/Bluetooth/system/test/
.
لإجراء اختبارات AOSP، اتّبِع الخطوات التالية:
- أوقِف بيئة تشغيل Android باتّباع الخطوات التالية:
adb shell stop
- من دليل الاختبار، شغِّل الملف القابل للتنفيذ الخاص بالبرامج النصية
وأدرِج الخيارات إذا كنت تريد إجراء اختبار أو مجموعة اختبارات معيّنة:
./run_unit_tests.sh TEST_GROUP_NAME TEST_NAME OPTIONS
- عند الانتهاء من الاختبارات، أعِد تفعيل "مُشغِّل Android":
adb shell start
يمكن العثور على قائمة أسماء الاختبارات في
/packages/modules/Bluetooth/system/test/README.md
.
حزمة ضبط الملف الشخصي
توفّر مجموعة Bluetooth SIG مجموعة أدوات ضبط الملف الشخصي للبلوتوث (PTS)، وهي أداة اختبار للتشغيل التفاعلي للبروتوكول والملف الشخصي.
لمزيد من المعلومات، يُرجى الاطّلاع على الموقع الإلكتروني
Bluetooth Profile Tuning Suite.
اختبارات CTS
تتضمّن مجموعة أدوات اختبار التوافق (CTS)
اختبارات لحزمة Bluetooth. تقع هذه المواقع في
cts/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth
.
خيارات تصحيح الأخطاء
يوفّر إطار عمل AOSP طرقًا مختلفة لتصحيح أخطاء بنية
البلوتوث في الجهاز، بما في ذلك السجلات وتقارير الأخطاء. قد لا تؤدي هذه الطرق
إلى حلّ المشاكل التي لا يمكن إعادة إنتاجها أو المشاكل الصوتية،
التي يمكن أن تتأثر بأجزاء متعددة من المنصة والجهاز.
تصحيح الأخطاء باستخدام تقارير الأخطاء
للتحقّق من حالة خدمة البلوتوث باستخدام dumpsys
،
استخدِم الأمر التالي:
adb shell dumpsys bluetooth_manager
تكون جميع رسائل السجل تلقائيًا من مستوى التتبُّع 2.
للاطّلاع على مزيد من المعلومات عن مستويات التسجيل وتغيير مستويات التسجيل
للملفات التجارية المختلفة، اطّلِع على
system/bt/conf/bt_stack.conf
.
لاستخراج سجلّات التتبّع من تقرير الخطأ، استخدِم نص برمجي
btsnooz
.
- الحصول على
btsnooz.py
- استخرِج النسخة النصية لتقرير الخطأ.
- شغِّل
btsnooz.py
على نسخة النص من تقرير الخطأ:
btsnooz.py BUG_REPORT.txt > BTSNOOP.log
تصحيح الأخطاء باستخدام السجلّات
في الإصدار 4.4 من Android والإصدارات الأحدث، يمكنك جمع سجلات BTSnoop يدويًا،
والتي تشبه تنسيق snoop في RFC 1761. تسجِّل هذه السجلات حزم
Host Controller Interface (HCI).
في معظم أجهزة Android، يتم تخزين السجلات فيملف
data/misc/bluetooth/logs
.
لأسباب تتعلّق بالخصوصية، لا يسجِّل BTSnoop الذي يعمل دائمًا "في الذاكرة" سوى
المعلومات والأحداث غير الشخصية. لتسجيل جميع البيانات، على المستخدم
تفعيل التطفل على واجهة تحكم المضيف للبلوتوث من خلال تنفيذ ما يلي:
- فعِّل خيارات المطوّرين على الجهاز.
- في قائمة خيارات المطوّرين، فعِّل الخيار
تفعيل سجلّ التتبُّع لواجهة تحكم مضيف البلوتوث.
- أعِد تشغيل البلوتوث لتفعيل التسجيل.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-06-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-06-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["To verify and debug the Bluetooth stack, use the tools provided in AOSP\nand the Bluetooth Special Interest Group's (SIG) tests.\n\nTest and verify\n\nTo test the Bluetooth stack, AOSP provides a mix of unit tests, CTS tests,\nand tools for the Bluetooth Profile Tuning Suite (PTS).\n\nUnit tests in AOSP\n\nAOSP includes functional and unit tests for the default Bluetooth stack.\nThese tests are located in [`/packages/modules/Bluetooth/system/test/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Bluetooth/system/test/).\nTo run the AOSP tests, do the following:\n\n1. Stop the Android runtime:\n\n adb shell stop\n\n2. From the test directory, run the shell executable file and include\n options if you want to run a specific test or test suite:\n\n ./run_unit_tests.sh \u003cvar translate=\"no\"\u003eTEST_GROUP_NAME\u003c/var\u003e \u003cvar translate=\"no\"\u003eTEST_NAME\u003c/var\u003e \u003cvar translate=\"no\"\u003eOPTIONS\u003c/var\u003e\n\n3. When the tests finish, re-enable the Android runtime:\n\n adb shell start\n\nThe list of test names can be found in\n[`/packages/modules/Bluetooth/system/test/README.md`](https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Bluetooth/system/test/README.md).\n\nProfile Tuning Suite\n\nThe Bluetooth SIG provides the Bluetooth PTS, a\ntesting tool for protocol and profile interoperability. For more\ninformation, see the [Bluetooth Profile Tuning Suite](https://www.bluetooth.com/develop-with-bluetooth/test-tools/profile-tuning-suite)\nsite.\n\nCTS tests\n\nThe [Compatibility Test Suite](/docs/compatibility/cts) (CTS) includes\ntests for the Bluetooth stack. These are located in\n[`cts/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth).\n\nDebugging options\n\nAOSP provides different methods of debugging a device's Bluetooth stack,\nincluding logs and bug reports. These methods may not work for issues that\ncannot be reproduced or for audio issues, which can be affected by multiple\nparts of the platform and device.\n\nDebugging with bug reports\n\nTo check the Bluetooth service status using `dumpsys`, use the following\ncommand: \n\n adb shell dumpsys bluetooth_manager\n\nBy default, all log messages are trace level 2. To find out more about\nthe logging levels and change the logging levels for different profiles,\nlook in [`system/bt/conf/bt_stack.conf`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Bluetooth/system/conf/bt_stack.conf).\n\nTo extract snoop logs from the bug report, use the `btsnooz` script.\n\n1. Get [`btsnooz.py`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Bluetooth/system/tools/scripts/btsnooz.py).\n\n2. Extract the text version of the bug report.\n\n3. Run `btsnooz.py` on the text version of the bug report:\n\n btsnooz.py BUG_REPORT.txt \u003e BTSNOOP.log\n\nDebugging with logs\n\nIn Android 4.4 and later, you can manually collect BTSnoop logs, which\nresemble the snoop format in [RFC 1761](https://www.rfc-editor.org/rfc/rfc1761). These logs capture the Host\nController Interface (HCI) packets. For most Android devices, the logs are\nstored in `data/misc/bluetooth/logs`.\n\nFor privacy reasons, always-on, \"in-memory\" BTSnoop only logs non-personal\ninformation and events. To log all data, the user needs to enable\nBluetooth HCI snoop by doing the following:\n\n1. Enable **Developer options** on the device.\n\n2. In the **Developer options** menu, activate the **Enable Bluetooth\n HCI snoop log** toggle.\n\n3. Restart Bluetooth for logging to take effect."]]